From b0f9e2bde172133cad260192be0933014d25e835 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Sat, 28 Sep 2024 16:58:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=AF=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../CustomerOrgGroupSimpleDto.cs | 16 +
.../ThirdBookingPushs/DecryptBaseDto.cs | 18 +
.../PushMedicalReportInputDto.cs | 73 +
.../ThirdBookingPushs/PushReportDecryptDto.cs | 19 +
.../PushReportFileInputDto.cs | 20 +
.../ThirdBookingPushAppService.cs | 306 +-
.../ThirdBookings/ThirdBookingAppService.cs | 6 +-
.../ThirdMedicalCenterAppService.cs | 52 +-
src/Shentun.Peis.Domain/AesHelper.cs | 119 +
.../PatientRegisters/PatientRegister.cs | 2 +-
.../ThirdBookings/ThirdBooking.cs | 2 +-
.../ThirdInterfaces/ThirdInterface.cs | 2 +-
src/Shentun.Peis.Domain/newRsaHelper.cs | 70 +
...rd_interface_parm_value_length.Designer.cs | 15959 ++++++++++++++++
...pdate_third_interface_parm_value_length.cs | 37 +
...9_update_patient_register_zimu.Designer.cs | 15959 ++++++++++++++++
...0928035619_update_patient_register_zimu.cs | 25 +
.../Migrations/PeisDbContextModelSnapshot.cs | 6 +-
18 files changed, 32618 insertions(+), 73 deletions(-)
create mode 100644 src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupSimpleDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/DecryptBaseDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushMedicalReportInputDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportDecryptDto.cs
create mode 100644 src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportFileInputDto.cs
create mode 100644 src/Shentun.Peis.Domain/AesHelper.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.Designer.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928035619_update_patient_register_zimu.Designer.cs
create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928035619_update_patient_register_zimu.cs
diff --git a/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupSimpleDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupSimpleDto.cs
new file mode 100644
index 0000000..c90e5a9
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupSimpleDto.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.CustomerOrgGroups
+{
+ public class CustomerOrgGroupSimpleDto
+ {
+ public Guid Id { get; set; }
+
+ ///
+ /// 分组名称
+ ///
+ public string DisplayName { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/DecryptBaseDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/DecryptBaseDto.cs
new file mode 100644
index 0000000..2d40b41
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/DecryptBaseDto.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdBookingPushs
+{
+ public class DecryptBaseDto
+ {
+ ///
+ /// 0:接收成功
+ /// 1:(体检预约类型:体检人员信息匹配失败、上门体检类型:信息已接收,不可变更)
+ /// 2:系统异常
+ ///
+ public int STATUS { get; set; }
+
+ public string MESSAGE { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushMedicalReportInputDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushMedicalReportInputDto.cs
new file mode 100644
index 0000000..6f1ed3b
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushMedicalReportInputDto.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdBookingPushs
+{
+ public class PushMedicalReportInputDto
+ {
+ ///
+ /// 体检年度
+ ///
+ public string YEAR { get; set; }
+
+ ///
+ /// 客户来源
+ ///
+ public string SOURCE { get; set; }
+
+ ///
+ /// 体检机构
+ ///
+ public string ORGCODE { get; set; }
+
+ ///
+ /// 第三方报告ID
+ ///
+ public string BUSINESSID { get; set; }
+
+ ///
+ /// 姓名
+ ///
+ public string NAME { get; set; }
+
+ ///
+ /// 证件类型
+ ///
+ public string IDTYPE { get; set; }
+
+ ///
+ /// 证件号
+ ///
+ public string IDNO { get; set; }
+
+
+
+ ///
+ /// 体检套餐编码
+ ///
+ public string EXAMPACKAGECODE { get; set; }
+
+
+ ///
+ /// 推送时间
+ ///
+ public string PUSHTIME { get; set; }
+
+ ///
+ /// 体检报告pdf文件base64
+ ///
+ public string PDFBASE64 { get; set; }
+
+ ///
+ /// 体检报告pdf文件ID
+ ///
+ public string PDFFILEID { get; set; }
+
+ ///
+ /// 体检报告json数据
+ ///
+ public string JSONBASE64 { get; set; }
+
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportDecryptDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportDecryptDto.cs
new file mode 100644
index 0000000..5cf4b72
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportDecryptDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdBookingPushs
+{
+ public class PushReportDecryptDto
+ {
+ ///
+ /// 接口调用状态
+ ///
+ public bool FLAG { get; set; }
+
+ ///
+ /// 接口调用结果信息
+ ///
+ public string MESSAGE { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportFileInputDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportFileInputDto.cs
new file mode 100644
index 0000000..bf4767a
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportFileInputDto.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.ThirdBookingPushs
+{
+ public class PushReportFileInputDto
+ {
+ ///
+ /// 人员id
+ ///
+ public Guid PatientRegisterId { get; set; }
+
+ ///
+ /// 报告base64
+ ///
+ public string ReportBase64 { get; set; }
+
+ }
+}
diff --git a/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs b/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
index 6604442..14ce103 100644
--- a/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
+++ b/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
@@ -17,6 +17,8 @@ using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using NPOI.POIFS.Crypt.Dsig;
+using NPOI.SS.Formula.Functions;
namespace Shentun.Peis.ThirdBookingPushs
{
@@ -65,7 +67,7 @@ namespace Shentun.Peis.ThirdBookingPushs
var registerApiAddress = interfaceConfig.GetSection("Interface").GetSection("RegisterApiAddress").Value;
var publicKey = interfaceConfig.GetSection("Interface").GetSection("YuanFuPublicKey").Value;
var privateKey = interfaceConfig.GetSection("Interface").GetSection("MinZhongPrivateKey").Value;
- var iCode = interfaceConfig.GetSection("Interface").GetSection("ICODE").Value;
+ var medicalYear = interfaceConfig.GetSection("Interface").GetSection("MedicalYear").Value;
var isActive = interfaceConfig.GetSection("Interface").GetSection("IsActive").Value;
if (!string.IsNullOrWhiteSpace(isActive)
&& isActive == "Y")
@@ -73,37 +75,51 @@ namespace Shentun.Peis.ThirdBookingPushs
var patientRegisterEnt = await _patientRegisterRepository.GetAsync(input.PatientRegisterId);
- if (patientRegisterEnt != null && string.IsNullOrWhiteSpace(patientRegisterEnt.ThirdBookingId))
+ if (patientRegisterEnt != null
+ && !string.IsNullOrWhiteSpace(patientRegisterEnt.ThirdBookingId))
{
var thirdBookingEnt = await _thirdBookingRepository.FirstOrDefaultAsync(f => f.Id == Guid.Parse(patientRegisterEnt.ThirdBookingId));
-
- var customerOrgGroupEnt = await _customerOrgGroupRepository.GetAsync(g => g.Id == Guid.Parse(thirdBookingEnt.CustomerOrgGroupId));
-
- var pushRegisterInput = new PushRegisterInputDto
+ string iCode = thirdBookingEnt.ICode;
+ if (thirdBookingEnt.MedicalStatus == '0')
{
- BOOKINGDATE = thirdBookingEnt.BookingDate.ToString("yyyy-MM-dd"),
- BOOKINGDATEDESC = "",
- BOOKINGID = patientRegisterEnt.ThirdBookingId,
- BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
- BOOKINGTYPE = "1",
- BOOKINGTYPEELSEDESC = "",
- CONFIRMORG = "MINZ",
- CONFIRMORGCENTERDESC = "民众",
- CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
- CONFIRMTYPE = "1",
- EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
- EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
- IDNO = thirdBookingEnt.IdNo,
- IDTYPE = thirdBookingEnt.IdType,
- MOBILE = thirdBookingEnt.Phone,
- NAME = patientRegisterEnt.PatientName,
- SOURCE = "BjGJ",
- YEAR = "2024"
- };
-
- var inputPara = GetEncryptData(JsonConvert.SerializeObject(pushRegisterInput), iCode, publicKey, privateKey);
-
- await CallBookingAppServiceAsync(baseApiAddress, registerApiAddress, inputPara);
+
+ var customerOrgGroupEnt = await _customerOrgGroupRepository.GetAsync(g => g.Id == Guid.Parse(thirdBookingEnt.CustomerOrgGroupId));
+
+ var pushRegisterInput = new PushRegisterInputDto
+ {
+ BOOKINGDATE = thirdBookingEnt.BookingDate.ToString("yyyy-MM-dd"),
+ BOOKINGDATEDESC = "",
+ BOOKINGID = patientRegisterEnt.ThirdBookingId,
+ BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
+ BOOKINGTYPE = "1",
+ BOOKINGTYPEELSEDESC = "",
+ CONFIRMORG = "MINZ",
+ CONFIRMORGCENTERDESC = "民众",
+ CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+ CONFIRMTYPE = "1",
+ EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
+ EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
+ IDNO = thirdBookingEnt.IdNo,
+ IDTYPE = thirdBookingEnt.IdType,
+ MOBILE = thirdBookingEnt.Phone,
+ NAME = patientRegisterEnt.PatientName,
+ SOURCE = "BjGJ",
+ YEAR = medicalYear
+ };
+
+ var inputPara = GetEncryptData(JsonConvert.SerializeObject(pushRegisterInput), iCode, publicKey, privateKey);
+
+ var resultPara = await CallBookingAppServiceAsync(baseApiAddress, registerApiAddress, inputPara, "application/json;charset=utf-8");
+ if (resultPara.FLAG)
+ {
+ var decryptDataPara = GetDecryptData(resultPara, publicKey, privateKey);
+ if (decryptDataPara.STATUS == 0)
+ {
+ thirdBookingEnt.MedicalStatus = '1';
+ await _thirdBookingRepository.UpdateAsync(thirdBookingEnt);
+ }
+ }
+ }
}
}
@@ -131,58 +147,193 @@ namespace Shentun.Peis.ThirdBookingPushs
var completeApiAddress = interfaceConfig.GetSection("Interface").GetSection("CompleteApiAddress").Value;
var publicKey = interfaceConfig.GetSection("Interface").GetSection("YuanFuPublicKey").Value;
var privateKey = interfaceConfig.GetSection("Interface").GetSection("MinZhongPrivateKey").Value;
- var iCode = interfaceConfig.GetSection("Interface").GetSection("ICODE").Value;
var isActive = interfaceConfig.GetSection("Interface").GetSection("IsActive").Value;
+ var medicalYear = interfaceConfig.GetSection("Interface").GetSection("MedicalYear").Value;
if (!string.IsNullOrWhiteSpace(isActive)
&& isActive == "Y")
{
var patientRegisterEnt = await _patientRegisterRepository.GetAsync(input.PatientRegisterId);
- if (patientRegisterEnt != null && string.IsNullOrWhiteSpace(patientRegisterEnt.ThirdBookingId))
+ //已总检才能上传
+ if (patientRegisterEnt != null
+ && !string.IsNullOrWhiteSpace(patientRegisterEnt.ThirdBookingId))
{
var thirdBookingEnt = await _thirdBookingRepository.FirstOrDefaultAsync(f => f.Id == Guid.Parse(patientRegisterEnt.ThirdBookingId));
+ string iCode = thirdBookingEnt.ICode;
+ if (thirdBookingEnt.MedicalStatus == '1')
+ {
+ var customerOrgGroupEnt = await _customerOrgGroupRepository.GetAsync(g => g.Id == Guid.Parse(thirdBookingEnt.CustomerOrgGroupId));
+
+ var pushCompletePhysicalInput = new PushCompletePhysicalInputDto
+ {
+ BOOKINGDATE = thirdBookingEnt.BookingDate.ToString("yyyy-MM-dd"),
+ BOOKINGDATEDESC = "",
+ BOOKINGID = patientRegisterEnt.ThirdBookingId,
+ BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
+ BOOKINGTYPE = "1",
+ BOOKINGTYPEELSEDESC = "",
+ CONFIRMORG = "MINZ",
+ CONFIRMORGCENTERDESC = "民众",
+ CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+ CONFIRMTYPE = "1",
+ EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
+ EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
+ IDNO = thirdBookingEnt.IdNo,
+ IDTYPE = thirdBookingEnt.IdType,
+ MOBILE = thirdBookingEnt.Phone,
+ NAME = patientRegisterEnt.PatientName,
+ SOURCE = "BjGJ",
+ YEAR = medicalYear,
+ AGE = patientRegisterEnt.Age == null ? (short)0 : patientRegisterEnt.Age.Value,
+ BIRTHDAY = patientRegisterEnt.BirthDate != null ? patientRegisterEnt.BirthDate.Value.ToString("yyyy-MM-dd") : "",
+ EXAMBEGINTIME = patientRegisterEnt.MedicalStartDate != null ? patientRegisterEnt.MedicalStartDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
+ EXAMCOMPLETETIME = patientRegisterEnt.SummaryDate != null ? patientRegisterEnt.SummaryDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
+ EXAMID = patientRegisterEnt.Id.ToString(),
+ GENDER = GetSexId(patientRegisterEnt.SexId)
+ };
+
+ var inputPara = GetEncryptData(JsonConvert.SerializeObject(pushCompletePhysicalInput), iCode, publicKey, privateKey);
+
+ var resultPara = await CallBookingAppServiceAsync(baseApiAddress, completeApiAddress, inputPara, "application/json;charset=utf-8");
+
+ if (resultPara.FLAG)
+ {
+ var decryptDataPara = GetDecryptData(resultPara, publicKey, privateKey);
+ if (decryptDataPara.STATUS == 0)
+ {
+ thirdBookingEnt.MedicalStatus = '2';
+ await _thirdBookingRepository.UpdateAsync(thirdBookingEnt);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+
+ ///
+ /// 推送体检报告
+ ///
+ ///
+ [HttpPost("api/app/ThirdBookingPush/PushReportFile")]
+ public async Task PushReportFileAsync(PushReportFileInputDto input)
+ {
+ var thirdBookingInterface = await _thirdInterfaceRepository.FirstOrDefaultAsync(o => o.ThirdInterfaceType ==
+ ThirdInterfaceTypeFlag.ThirdBooking);
+ if (thirdBookingInterface != null && thirdBookingInterface.IsActive == 'Y')
+ {
- var customerOrgGroupEnt = await _customerOrgGroupRepository.GetAsync(g => g.Id == Guid.Parse(thirdBookingEnt.CustomerOrgGroupId));
+ var parmValue = thirdBookingInterface.ParmValue;
+ var configurationBuilder = new ConfigurationBuilder()
+ .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
+ var interfaceConfig = configurationBuilder.Build();
+ var baseApiAddress = interfaceConfig.GetSection("Interface").GetSection("BaseApiAddress").Value;
+ var completeApiAddress = interfaceConfig.GetSection("Interface").GetSection("CompleteApiAddress").Value;
+ var publicKey = interfaceConfig.GetSection("Interface").GetSection("YuanFuPublicKey").Value;
+ var privateKey = interfaceConfig.GetSection("Interface").GetSection("MinZhongPrivateKey").Value;
+ var aesKey = interfaceConfig.GetSection("Interface").GetSection("AesKey").Value;
+ var isActive = interfaceConfig.GetSection("Interface").GetSection("IsActive").Value;
+ var medicalYear = interfaceConfig.GetSection("Interface").GetSection("MedicalYear").Value;
+ if (!string.IsNullOrWhiteSpace(isActive)
+ && isActive == "Y")
+ {
- var pushCompletePhysicalInput = new PushCompletePhysicalInputDto
+ var patientRegisterEnt = await _patientRegisterRepository.GetAsync(input.PatientRegisterId);
+
+ if (patientRegisterEnt != null
+ && !string.IsNullOrWhiteSpace(patientRegisterEnt.ThirdBookingId)
+ && patientRegisterEnt.CompleteFlag == PatientRegisterCompleteFlag.SumCheck)
+ {
+ var thirdBookingEnt = await _thirdBookingRepository.FirstOrDefaultAsync(f => f.Id == Guid.Parse(patientRegisterEnt.ThirdBookingId));
+ string iCode = thirdBookingEnt.ICode;
+ if (thirdBookingEnt.MedicalStatus == '2')
{
- BOOKINGDATE = thirdBookingEnt.BookingDate.ToString("yyyy-MM-dd"),
- BOOKINGDATEDESC = "",
- BOOKINGID = patientRegisterEnt.ThirdBookingId,
- BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
- BOOKINGTYPE = "1",
- BOOKINGTYPEELSEDESC = "",
- CONFIRMORG = "MINZ",
- CONFIRMORGCENTERDESC = "民众",
- CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
- CONFIRMTYPE = "1",
- EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
- EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
- IDNO = thirdBookingEnt.IdNo,
- IDTYPE = thirdBookingEnt.IdType,
- MOBILE = thirdBookingEnt.Phone,
- NAME = patientRegisterEnt.PatientName,
- SOURCE = "BjGJ",
- YEAR = "2024",
- AGE = patientRegisterEnt.Age == null ? (short)0 : patientRegisterEnt.Age.Value,
- BIRTHDAY = patientRegisterEnt.BirthDate != null ? patientRegisterEnt.BirthDate.Value.ToString("yyyy-MM-dd") : "",
- EXAMBEGINTIME = patientRegisterEnt.MedicalStartDate != null ? patientRegisterEnt.MedicalStartDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
- EXAMCOMPLETETIME = patientRegisterEnt.SummaryDate != null ? patientRegisterEnt.SummaryDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
- EXAMID = patientRegisterEnt.Id.ToString(),
- GENDER = GetSexId(patientRegisterEnt.SexId)
- };
-
- var inputPara = GetEncryptData(JsonConvert.SerializeObject(pushCompletePhysicalInput), iCode, publicKey, privateKey);
-
- await CallBookingAppServiceAsync(baseApiAddress, completeApiAddress, inputPara);
+ var customerOrgGroupEnt = await _customerOrgGroupRepository.GetAsync(g => g.Id == Guid.Parse(thirdBookingEnt.CustomerOrgGroupId));
+
+
+ #region 上传文件
+ byte[] filebytes = Convert.FromBase64String(input.ReportBase64);
+ string fileDataEncrypt = AesHelper.AESEncrypt(filebytes, aesKey);
+ string fileSign = AesHelper.GetMD5Hash(fileDataEncrypt);
+ var fileInputParm = new EncryDataRequstDto
+ {
+ DATA = fileDataEncrypt,
+ SIGN = fileSign,
+ ICODE = thirdBookingEnt.ICode
+ };
+
+ var fileResultEncry = await CallBookingAppServiceAsync(baseApiAddress, completeApiAddress, fileInputParm, "multipart/form-data");
+
+ if (fileResultEncry.FLAG)
+ {
+ //验签
+ if (fileResultEncry.SIGN == AesHelper.GetMD5Hash(fileResultEncry.DATA))
+ {
+ //解密
+ string fileResultStr = AesHelper.AESDecrypt(fileResultEncry.DATA, aesKey); //报文ID
+
+
+ #region 上传报告
+
+ var pushMedicalReportInput = new PushMedicalReportInputDto
+ {
+ EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
+ IDNO = thirdBookingEnt.IdNo,
+ IDTYPE = thirdBookingEnt.IdType,
+ NAME = patientRegisterEnt.PatientName,
+ SOURCE = "BjGJ",
+ YEAR = medicalYear,
+ BUSINESSID = patientRegisterEnt.Id.ToString(),
+ JSONBASE64 = "",
+ ORGCODE = "MINZ",
+ PDFBASE64 = "",
+ PDFFILEID = fileResultStr,
+ PUSHTIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+ };
+
+
+ var pushMedicalReportInputEncrypt = GetEncryptData(JsonConvert.SerializeObject(pushMedicalReportInput), iCode, publicKey, privateKey);
+
+ var reportResultPara = await CallBookingAppServiceAsync(baseApiAddress, completeApiAddress, pushMedicalReportInputEncrypt, "application/json;charset=utf-8");
+
+ if (reportResultPara.FLAG)
+ {
+ var decryptDataPara = GetDecryptData(reportResultPara, publicKey, privateKey);
+ if (decryptDataPara.FLAG == true)
+ {
+ thirdBookingEnt.MedicalStatus = '3';
+ await _thirdBookingRepository.UpdateAsync(thirdBookingEnt);
+ }
+ }
+
+ #endregion
+
+ }
+
+
+ }
+
+ #endregion
+
+
+
+
+
+
+ }
}
}
}
+
+
}
+
///
/// 发起请求
///
@@ -191,10 +342,10 @@ namespace Shentun.Peis.ThirdBookingPushs
///
///
///
+ ///
///
///
- ///
- private async Task CallBookingAppServiceAsync(string baseApiAddress, string url, TInput data, string method = "post")
+ private async Task CallBookingAppServiceAsync(string baseApiAddress, string url, TInput data, string contentType, string method = "post")
{
using (var httpClientHandler = new HttpClientHandler())
{
@@ -208,7 +359,7 @@ namespace Shentun.Peis.ThirdBookingPushs
var sendData = JsonConvert.SerializeObject(data);
using (HttpContent httpContent = new StringContent(sendData))
{
- httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json;charset=utf-8");
+ httpContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);
HttpResponseMessage response = null;
if (method == "post")
{
@@ -260,6 +411,31 @@ namespace Shentun.Peis.ThirdBookingPushs
return result;
}
+ ///
+ /// 返回数据密文解密
+ ///
+ /// 返回的密文对象
+ /// 对方公钥
+ /// 自己私钥
+ ///
+ private static TOut GetDecryptData(EncryDataResultDto encryDataResultDto, string publicKey, string privateKey)
+ {
+
+ bool isVerify = newRsaHelper.VerifySignature(encryDataResultDto.DATA, Convert.FromBase64String(encryDataResultDto.SIGN), publicKey);
+ if (isVerify)
+ {
+ string resultStr = newRsaHelper.RSADecrypt(encryDataResultDto.DATA, privateKey);
+ TOut resultDto = JsonConvert.DeserializeObject(resultStr);
+ return resultDto;
+ }
+ else
+ {
+ return default(TOut);
+ }
+
+
+ }
+
///
/// 转换性别
///
diff --git a/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs b/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
index 7ce0016..59d10a9 100644
--- a/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
+++ b/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
@@ -10,6 +10,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
@@ -64,7 +65,10 @@ namespace Shentun.Peis.ThirdBookings
customerOrgId = Guid.Parse(customerOrgIdPara);
}
}
-
+ else
+ {
+ throw new UserFriendlyException("请开启第三方预约");
+ }
var query = await _thirdBookingRepository.GetQueryableAsync();
if (!string.IsNullOrWhiteSpace(input.StartDate) && !string.IsNullOrWhiteSpace(input.StartDate))
{
diff --git a/src/Shentun.Peis.Application/ThirdMedicalCenters/ThirdMedicalCenterAppService.cs b/src/Shentun.Peis.Application/ThirdMedicalCenters/ThirdMedicalCenterAppService.cs
index 0d319b6..dff1fa8 100644
--- a/src/Shentun.Peis.Application/ThirdMedicalCenters/ThirdMedicalCenterAppService.cs
+++ b/src/Shentun.Peis.Application/ThirdMedicalCenters/ThirdMedicalCenterAppService.cs
@@ -10,6 +10,11 @@ using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
+using Shentun.Peis.CustomerOrgRegisters;
+using Shentun.Peis.CustomerOrgGroups;
+using Microsoft.Extensions.Configuration;
+using Shentun.Peis.Enums;
+using System.IO;
namespace Shentun.Peis.ThirdMedicalCenters
{
@@ -26,16 +31,22 @@ namespace Shentun.Peis.ThirdMedicalCenters
private readonly CacheService _cacheService;
private readonly ThirdMedicalCenterManager _thirdMedicalCenterManager;
private readonly IRepository _thirdMedicalCenterBookingDateRepository;
+ private readonly IRepository _customerOrgGroupRepository;
+ private readonly IRepository _thirdInterfaceRepository;
public ThirdMedicalCenterAppService(
IRepository thirdMedicalCenterRepository,
CacheService cacheService,
ThirdMedicalCenterManager thirdMedicalCenterManager,
- IRepository thirdMedicalCenterBookingDateRepository)
+ IRepository thirdMedicalCenterBookingDateRepository,
+ IRepository customerOrgGroupRepository,
+ IRepository thirdInterfaceRepository)
{
_thirdMedicalCenterRepository = thirdMedicalCenterRepository;
_cacheService = cacheService;
_thirdMedicalCenterManager = thirdMedicalCenterManager;
_thirdMedicalCenterBookingDateRepository = thirdMedicalCenterBookingDateRepository;
+ _customerOrgGroupRepository = customerOrgGroupRepository;
+ _thirdInterfaceRepository = thirdInterfaceRepository;
}
///
@@ -162,6 +173,45 @@ namespace Shentun.Peis.ThirdMedicalCenters
}
+ ///
+ /// 获取特定单位分组
+ ///
+ ///
+ [HttpPost("api/app/ThirdMedicalCenter/GetCustomerOrgGroupList")]
+ public async Task> GetCustomerOrgGroupListAsync()
+ {
+ Guid? customerOrgRegisterId = null;
+
+ var thirdBookingInterface = await _thirdInterfaceRepository.FirstOrDefaultAsync(o => o.ThirdInterfaceType ==
+ ThirdInterfaceTypeFlag.ThirdBooking);
+ if (thirdBookingInterface != null && thirdBookingInterface.IsActive == 'Y')
+ {
+
+ var parmValue = thirdBookingInterface.ParmValue;
+ var configurationBuilder = new ConfigurationBuilder()
+ .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
+ var interfaceConfig = configurationBuilder.Build();
+ var customerOrgRegisterIdPara = interfaceConfig.GetSection("Interface").GetSection("CustomerOrgRegisterId").Value;
+ if (!string.IsNullOrWhiteSpace(customerOrgRegisterIdPara))
+ {
+ customerOrgRegisterId = Guid.Parse(customerOrgRegisterIdPara);
+ }
+ }
+
+ var query = await _customerOrgGroupRepository.GetQueryableAsync();
+ if (customerOrgRegisterId != null)
+ {
+ query = query.Where(m => m.CustomerOrgRegisterId == customerOrgRegisterId.Value);
+ }
+ var entListDto = query.OrderBy(o => o.DisplayOrder).Select(s => new CustomerOrgGroupSimpleDto
+ {
+ DisplayName = s.DisplayName,
+ Id = s.Id
+ }).ToList();
+ return entListDto;
+ }
+
+
///
/// 根据体检中心获取可预约日期
///
diff --git a/src/Shentun.Peis.Domain/AesHelper.cs b/src/Shentun.Peis.Domain/AesHelper.cs
new file mode 100644
index 0000000..59209ae
--- /dev/null
+++ b/src/Shentun.Peis.Domain/AesHelper.cs
@@ -0,0 +1,119 @@
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Security.Cryptography;
+using System.IO;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Crypto;
+using Org.BouncyCastle.Security;
+using Org.BouncyCastle.Utilities;
+
+namespace Shentun.Peis
+{
+ public class AesHelper
+ {
+ private static readonly byte[] Key = Encoding.UTF8.GetBytes("1234567812345678"); // 16字节密钥
+ private static readonly byte[] Iv = Encoding.UTF8.GetBytes("1234567812345678"); // 16字节初始化向量
+
+ ///
+ /// MD5加密
+ ///
+ ///
+ ///
+ public static string GetMD5Hash(string input)
+ {
+ using (MD5 md5 = MD5.Create())
+ {
+ byte[] inputBytes = Encoding.UTF8.GetBytes(input);
+ byte[] hashBytes = md5.ComputeHash(inputBytes);
+
+ // Convert byte array to a hexadecimal string
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < hashBytes.Length; i++)
+ {
+ sb.Append(hashBytes[i].ToString("x2"));
+ }
+ return sb.ToString();
+ }
+ }
+
+ ///
+ /// 解密
+ ///
+ ///
+ ///
+ ///
+ public static string AESDecrypt(string strinput, string strkey)
+ {
+ try
+ {
+ //string dummyData = strinput.Trim().Replace("%", "").Replace(",", "").Replace(" ", "+").Replace("_", "/").Replace("-", "+");
+ //if (dummyData.Length % 4 > 0)
+ //{
+ // dummyData = dummyData.PadRight(dummyData.Length + 4 - dummyData.Length % 4, '=');
+ //}
+ byte[] inputArray = Convert.FromBase64String(strinput);
+ byte[] key = Encoding.UTF8.GetBytes(strkey);
+
+ IBufferedCipher cipher = CipherUtilities.GetCipher("AES/ECB/PKCS5Padding");
+
+ cipher.Init(false, AesKey(strkey));
+ // cipher.Init(false, new ParametersWithIV(new DesParameters(key), key)); 带IV向量的算法可以用到。
+ byte[] rv = new byte[cipher.GetOutputSize(inputArray.Length)];
+ int tam = cipher.ProcessBytes(inputArray, 0, inputArray.Length, rv, 0);
+ cipher.DoFinal(rv, tam);
+ return Encoding.UTF8.GetString(rv);
+
+ }
+ catch (Exception ex)
+ {
+
+ return "";
+
+ }
+
+ }
+
+ ///
+ /// 加密
+ ///
+ ///
+ ///
+ ///
+ public static string AESEncrypt(byte[] inputArray, string strkey)
+ {
+ try
+ {
+ //byte[] inputArray = Encoding.UTF8.GetBytes(strinput);
+ byte[] key = Encoding.UTF8.GetBytes(strkey);
+
+ IBufferedCipher cipher = CipherUtilities.GetCipher("AES/ECB/PKCS5Padding");
+ //cipher.Init(true, new ParametersWithIV(new DesParameters(key), key));
+ cipher.Init(true, AesKey(strkey));
+ byte[] rv = new byte[cipher.GetOutputSize(inputArray.Length)];
+ int tam = cipher.ProcessBytes(inputArray, 0, inputArray.Length, rv, 0);
+ cipher.DoFinal(rv, tam);
+ return Convert.ToBase64String(rv);
+
+ }
+ catch (Exception ex)
+ {
+ return "";
+ }
+ }
+
+
+ public static KeyParameter AesKey(String key)
+ {
+ byte[] bs = Encoding.Default.GetBytes(key);
+ if (bs.Length != 16)
+ {
+ bs = Arrays.CopyOf(bs, 16);// 处理数组长度为16(不足16位,不空;超过16位取前16位)
+ }
+ return new KeyParameter(bs);
+ }
+ }
+}
diff --git a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
index 117cd18..7771677 100644
--- a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
+++ b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
@@ -318,7 +318,7 @@ namespace Shentun.Peis.Models
///
/// 第三方预约登记ID
///
- [Column("Third_Booking_Id")]
+ [Column("third_booking_id")]
public string ThirdBookingId { get; set; }
[Column("concurrency_stamp")]
diff --git a/src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs b/src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs
index ab8f7de..3bcc923 100644
--- a/src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs
+++ b/src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs
@@ -101,7 +101,7 @@ namespace Shentun.Peis.Models
public string MaritalStatusName { get; set; }
///
- /// 体检状态 0未开始 1已登记 2已完成体检
+ /// 体检状态 0未开始 1已登记 2已完成体检 3已推送报告
///
[Column("medical_status")]
public char MedicalStatus { get; set; }
diff --git a/src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterface.cs b/src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterface.cs
index c828896..512068f 100644
--- a/src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterface.cs
+++ b/src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterface.cs
@@ -36,7 +36,7 @@ namespace Shentun.Peis.Models
/// 配置参数
///
[Column("parm_value")]
- [StringLength(2000)]
+ [StringLength(6000)]
public string ParmValue { get; set; }
///
diff --git a/src/Shentun.Peis.Domain/newRsaHelper.cs b/src/Shentun.Peis.Domain/newRsaHelper.cs
index 25d75a9..146e696 100644
--- a/src/Shentun.Peis.Domain/newRsaHelper.cs
+++ b/src/Shentun.Peis.Domain/newRsaHelper.cs
@@ -127,6 +127,76 @@ namespace Shentun.Peis
+ ///
+ /// 验签
+ ///
+ ///
+ ///
+ /// 对方公钥
+ ///
+ public static bool VerifySignature(string message, byte[] signature,string publicKey)
+ {
+ bool isValid = false;
+ string yuanFuPublicKey_Net = RSAPublicKeyJava2DotNet(publicKey);
+
+ using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
+ {
+ try
+ {
+ rsa.FromXmlString(yuanFuPublicKey_Net);
+
+ // 验证签名
+ isValid = rsa.VerifyData(Encoding.UTF8.GetBytes(message), CryptoConfig.MapNameToOID("MD5"), signature);
+
+ // 验证签名
+
+ }
+ catch (Exception ex)
+ {
+
+ }
+ finally
+ {
+ rsa.PersistKeyInCsp = false;
+ }
+
+ }
+
+ return isValid;
+ }
+
+
+ ///
+ /// 解密
+ ///
+ ///
+ /// 自己私钥
+ ///
+ public static string RSADecrypt(string bizContent,string privateKey)
+ {
+
+ string minZhongPrivateKey_Net = RSAPrivateKeyJava2DotNet(privateKey);
+
+ //此处请根据需要设置集合capacity,也可不指定
+ var encryptedData = new List(45000);
+ using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
+ {
+ rsa.FromXmlString(minZhongPrivateKey_Net);
+
+ int start = 0;
+ var bytes = Convert.FromBase64String(bizContent).AsSpan();
+ while (start < bytes.Length)
+ {
+ var buffer = bytes.Length - start <= _maxDecryptSize
+ ? bytes.Slice(start).ToArray() : bytes.Slice(start, _maxDecryptSize).ToArray();
+
+ encryptedData.AddRange(rsa.Decrypt(buffer, false));
+
+ start += _maxDecryptSize;
+ };
+ }
+ return Encoding.UTF8.GetString(encryptedData.ToArray());
+ }
}
}
diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.Designer.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.Designer.cs
new file mode 100644
index 0000000..45c9012
--- /dev/null
+++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.Designer.cs
@@ -0,0 +1,15959 @@
+//
+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("20240928015112_update_third_interface_parm_value_length")]
+ partial class update_third_interface_parm_value_length
+ {
+ 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(100)
+ .HasColumnType("character varying(100)")
+ .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("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("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("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.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("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")
+ .IsRequired()
+ .HasMaxLength(18)
+ .HasColumnType("character varying(18)")
+ .HasColumnName("id_no")
+ .HasComment("身份证号");
+
+ 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")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("mobile_telephone")
+ .HasComment("手机");
+
+ b.Property("Remark")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .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")
+ .IsUnique();
+
+ 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("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999")
+ .HasComment("显示顺序");
+
+ b.Property("ExpiryDay")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("expiry_day")
+ .HasDefaultValueSql("3650")
+ .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("Remark")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("remark")
+ .HasComment("备注");
+
+ b.HasKey("Id");
+
+ b.ToTable("card_type");
+
+ b.HasComment("会员卡类别");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.Charge", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("收据号");
+
+ b.Property("ChargeFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("charge_flag")
+ .HasDefaultValueSql("0");
+
+ 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("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")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("PatientRegisterId")
+ .HasColumnType("uuid")
+ .HasColumnName("patient_register_id")
+ .HasComment("登记流水号");
+
+ b.Property