From afe13a3547201d31a2afeb912deef502c4b6e87f Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Thu, 6 Jun 2024 17:28:41 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 .../CustomerOrgs/CustomerOrgTreeChildDto.cs   |    40 +
 .../UpdatePatientRegisterAuditorDoctorDto.cs  |     2 +-
 .../CustomerOrgs/CustomerOrgAppService.cs     |    50 +-
 .../BaseDataHandleAppService.cs               |    43 +-
 .../PeisReports/PeisReportAppService.cs       |     8 +-
 .../TransToWebPeisAppService.cs               |    32 +-
 .../CustomerOrgs/CustomerOrg.cs               |     7 +
 .../CustomerOrgs/CustomerOrgManager.cs        |    53 +-
 ...20240605134759_init20240605002.Designer.cs | 14969 ++++++++++++++++
 .../20240605134759_init20240605002.cs         |    26 +
 .../Migrations/PeisDbContextModelSnapshot.cs  |     5 +
 11 files changed, 15193 insertions(+), 42 deletions(-)
 create mode 100644 src/Shentun.Peis.Application.Contracts/CustomerOrgs/CustomerOrgTreeChildDto.cs
 create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240605134759_init20240605002.Designer.cs
 create mode 100644 src/Shentun.Peis.EntityFrameworkCore/Migrations/20240605134759_init20240605002.cs
diff --git a/src/Shentun.Peis.Application.Contracts/CustomerOrgs/CustomerOrgTreeChildDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerOrgs/CustomerOrgTreeChildDto.cs
new file mode 100644
index 0000000..5240524
--- /dev/null
+++ b/src/Shentun.Peis.Application.Contracts/CustomerOrgs/CustomerOrgTreeChildDto.cs
@@ -0,0 +1,40 @@
+using Shentun.Peis.OrganizationUnits;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shentun.Peis.CustomerOrgs
+{
+    public class CustomerOrgTreeChildDto
+    {
+        //组织Id
+        public Guid Id { get; set; }
+        //组织名称
+        public string DisplayName { get; set; }
+        //父节点Id
+        public Guid? ParentId { get; set; }
+        /// 
+        /// 用来做递归的 新用法
+        /// 
+        public string Code { get; set; }
+
+        /// 
+        /// 短名称
+        /// 
+        public string ShortName { get; set; }
+
+        /// 
+        /// 单位编码
+        /// 
+        public string CustomerOrgCode { get; set; }
+
+        /// 
+        /// 拼音简码
+        /// 
+        public string SimpleCode { get; set; }
+
+        public int DisplayOrder { get; set; }
+
+        public List TreeChildren { get; set; }
+    }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterAuditorDoctorDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterAuditorDoctorDto.cs
index 9f0ca59..1b4562b 100644
--- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterAuditorDoctorDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterAuditorDoctorDto.cs
@@ -14,7 +14,7 @@ namespace Shentun.Peis.PatientRegisters
         /// 
         /// 审核医生(不传默认为当前用户)
         /// 
-        public string? AuditDoctor { get; set; }
+        public string? AuditDoctorId { get; set; }
         /// 
         /// 审核日期(格式:2023-07-18) 空值跟null取当前日期
         /// 
diff --git a/src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs b/src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs
index f199a99..00541b4 100644
--- a/src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs
+++ b/src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs
@@ -278,27 +278,56 @@ namespace Shentun.Peis.CustomerOrgs
         /// 名字搜索,支持模糊查找
         /// 
         [HttpGet("api/app/customerorg/getbycodeall")]
-        public async Task> GetByCodeAllAsync(string Filter, int IsHidePerson = 0)
+        public async Task> GetByCodeAllAsync(string Filter, int IsHidePerson = 0)
         {
-            var dataList = await Repository.GetListAsync();
+
+            List result = new List();
+
+            var customerOrgPerson = await Repository.FirstOrDefaultAsync(f => f.Id == GuidFlag.PersonCustomerOrgId);
+
+            var dataList = (await Repository.GetQueryableAsync());
             if (!string.IsNullOrEmpty(Filter))
-                dataList = dataList.Where(m => m.DisplayName.Contains(Filter) || m.ShortName.Contains(Filter)).ToList();
+                dataList = dataList.Where(m => m.DisplayName.Contains(Filter) || m.ShortName.Contains(Filter));
             if (IsHidePerson == 1)
             {
-                dataList = dataList.Where(m => m.Id != GuidFlag.PersonCustomerOrgId).ToList();
+                dataList = dataList.Where(m => m.Id != GuidFlag.PersonCustomerOrgId);
+            }
+            else
+            {
+                if (customerOrgPerson != null)
+                {
+                    result.Add(new CustomerOrgTreeChildDto
+                    {
+                        Code = customerOrgPerson.PathCode,
+                        CustomerOrgCode = customerOrgPerson.CustomerOrgCode,
+                        DisplayName = customerOrgPerson.DisplayName,
+                        DisplayOrder = customerOrgPerson.DisplayOrder,
+                        Id = customerOrgPerson.Id,
+                        ParentId = customerOrgPerson.ParentId,
+                        ShortName = customerOrgPerson.ShortName,
+                        SimpleCode = customerOrgPerson.SimpleCode,
+                        TreeChildren = null
+                    });
+                }
             }
 
-            var items = from p in dataList.OrderBy(o => o.DisplayOrder)
-                        select new TreeChildViewDto()
+            var items = from p in dataList.Where(m => m.Id != GuidFlag.PersonCustomerOrgId).OrderByDescending(o => o.DisplayOrder)
+                        select new CustomerOrgTreeChildDto()
                         {
                             Id = p.Id,
                             ParentId = p.ParentId,
                             Code = p.PathCode,
                             DisplayName = p.DisplayName,
                             SimpleCode = p.SimpleCode,
-                            ShortName = p.ShortName
+                            ShortName = p.ShortName,
+                            CustomerOrgCode = p.CustomerOrgCode
                         };
-            return GetTree(items.ToList(), 0, "");
+            var customerOrgTreeChildList = GetTree(items.ToList(), 0, "");
+
+
+            result.AddRange(customerOrgTreeChildList);
+
+            return result;
         }
 
         /// 
@@ -308,12 +337,12 @@ namespace Shentun.Peis.CustomerOrgs
         /// 
         /// 
         /// 
-        private List GetTree(List items, int deep, string prefix)
+        private List GetTree(List items, int deep, string prefix)
         {
             return (from p in items
                     where p.Code.StartsWith(prefix) && p.Code.Count(a => a == '.') == deep
                     let subs = GetTree(items, deep + 1, p.Code)
-                    select new TreeChildViewDto()
+                    select new CustomerOrgTreeChildDto()
                     {
                         Id = p.Id,
                         ParentId = p.ParentId,
@@ -321,6 +350,7 @@ namespace Shentun.Peis.CustomerOrgs
                         DisplayName = p.DisplayName,
                         SimpleCode = p.SimpleCode,
                         ShortName = p.ShortName,
+                        CustomerOrgCode = p.CustomerOrgCode,
                         TreeChildren = subs.ToList()
                     }
                     ).ToList();
diff --git a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
index 5c62c95..caee20b 100644
--- a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
+++ b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
@@ -3114,24 +3114,24 @@ namespace Shentun.Peis.DataMigrations
                 foreach (var item in TempDate)
                 {
                     using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
-                    { 
+                    {
                         #region 修复建议头ID
                         var sumDiagnosisList = await _sumDiagnosisRepository.GetListAsync(m => m.PatientRegisterId == item.Id);
 
-                    foreach (var sumDiagnosis in sumDiagnosisList)
-                    {
-                        var isSumSuggestionHeaderId = await _sumSuggestionHeaderRepository.CountAsync(c => c.Id == sumDiagnosis.SumSuggestionHeaderId);
-                        if (isSumSuggestionHeaderId == 0)
+                        foreach (var sumDiagnosis in sumDiagnosisList)
                         {
-                            var sumSuggestionContentEnt = await _sumSuggestionContentRepository.FirstOrDefaultAsync(m => m.Id == sumDiagnosis.SumSuggestionHeaderId);
-                            if (sumSuggestionContentEnt != null)
+                            var isSumSuggestionHeaderId = await _sumSuggestionHeaderRepository.CountAsync(c => c.Id == sumDiagnosis.SumSuggestionHeaderId);
+                            if (isSumSuggestionHeaderId == 0)
                             {
-                                sumDiagnosis.SumSuggestionHeaderId = sumSuggestionContentEnt.SumSuggestionHeaderId;
+                                var sumSuggestionContentEnt = await _sumSuggestionContentRepository.FirstOrDefaultAsync(m => m.Id == sumDiagnosis.SumSuggestionHeaderId);
+                                if (sumSuggestionContentEnt != null)
+                                {
+                                    sumDiagnosis.SumSuggestionHeaderId = sumSuggestionContentEnt.SumSuggestionHeaderId;
+                                }
                             }
                         }
-                    }
 
-                    await _sumDiagnosisRepository.UpdateManyAsync(sumDiagnosisList);
+                        await _sumDiagnosisRepository.UpdateManyAsync(sumDiagnosisList);
 
                         #endregion
 
@@ -5241,6 +5241,29 @@ namespace Shentun.Peis.DataMigrations
                 return "";
         }
 
+        /// 
+        /// 同步单位编号
+        /// 
+        /// 
+        public async Task UpdateCustomerOrgData()
+        {
+            var customerOrgs = await _customerOrgRepository.GetListAsync();
+            foreach (var item in customerOrgs)
+            {
+                var oldKeyEnt = await _fieldComparisonRepository.FirstOrDefaultAsync(m => m.TableName == "customer_org" && m.NewKeyValue == item.Id.ToString());
+                if (oldKeyEnt != null)
+                {
+                    item.CustomerOrgCode = oldKeyEnt.OldKeyValue;
+                }
+                else
+                {
+                    item.CustomerOrgCode = "";
+                }
+
+                await _customerOrgRepository.UpdateAsync(item);
+            }
+        }
+
     }
 
 
diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
index 157c73d..296f8ab 100644
--- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
+++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
@@ -243,10 +243,10 @@ namespace Shentun.Peis.PeisReports
                 {
                     sumquery = sumquery.Where(m => m.a.CompleteFlag == input.CompleteFlag);
                 }
-                else
-                {
-                    sumquery = sumquery.Where(m => m.a.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration);
-                }
+                //else
+                //{
+                //    sumquery = sumquery.Where(m => m.a.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration);
+                //}
 
                 if (input.IsAudit != null)
                 {
diff --git a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs
index 4f9d5a5..0e6c077 100644
--- a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs
+++ b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs
@@ -168,6 +168,12 @@ namespace Shentun.Peis.TransToWebPeis
         [HttpPost("api/app/TransToWebPeis/UploadPeisReport")]
         public async Task UploadPeisReportAsync(UploadPeisReportIuputDto input)
         {
+
+            var isPatientRegister = await _patientRegisterRepository.FirstOrDefaultAsync(f => f.Id == input.PatientRegisterId);
+            if (isPatientRegister == null)
+                throw new UserFriendlyException("人员不存在");
+            if (isPatientRegister.CompleteFlag != PatientRegisterCompleteFlag.SumCheck)
+                throw new UserFriendlyException("人员未总检,无法上传");
             //同步数据
             await TransPatientRegisterByPatientRegisterIdAsync(new PatientRegisterIdInputDto { PatientRegisterId = input.PatientRegisterId });
             //上传报告
@@ -693,13 +699,13 @@ namespace Shentun.Peis.TransToWebPeis
             {
                 foreach (var customerOrgGroup in customerOrgGroups)
                 {
-                    await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.customer_org_group(customer_org_group_id, display_name, price, for_sex_id, marital_status_id, age_lower_limit, age_upper_limit," +
+                    await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.customer_org_group(customer_org_group_id, customer_org_group_name, price, for_sex_id, marital_status_id, age_lower_limit, age_upper_limit," +
                         "job_post, job_title, remark, display_order, customer_org_register_id, concurrency_stamp, creation_time, creator_id,last_modification_time, last_modifier_id) " +
-                          "VALUES (@customer_org_group_id,@display_name,@price,@for_sex_id,@marital_status_id,@age_lower_limit,@age_upper_limit," +
+                          "VALUES (@customer_org_group_id,@customer_org_group_name,@price,@for_sex_id,@marital_status_id,@age_lower_limit,@age_upper_limit," +
                           "@job_post,@job_title,@remark,@display_order,@customer_org_register_id,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);",
                               new List() {
                                   new SugarParameter("customer_org_group_id",customerOrgGroup.Id),
-                                  new SugarParameter("display_name",customerOrgGroup.DisplayName),
+                                  new SugarParameter("customer_org_group_name",customerOrgGroup.DisplayName),
                                   new SugarParameter("price",customerOrgGroup.Price),
                                   new SugarParameter("for_sex_id",customerOrgGroup.ForSexId),
                                   new SugarParameter("marital_status_id",customerOrgGroup.MaritalStatusId),
@@ -779,8 +785,8 @@ namespace Shentun.Peis.TransToWebPeis
                     .Where(m => m.Id == PatientRegisterId).FirstOrDefault();
                 if (patientRegisterEnt != null)
                 {
-                    if (patientRegisterEnt.CompleteFlag != PatientRegisterCompleteFlag.SumCheck)
-                        throw new UserFriendlyException("人员未总检,不能同步");
+                    //if (patientRegisterEnt.CompleteFlag != PatientRegisterCompleteFlag.SumCheck)
+                    //    throw new UserFriendlyException("人员未总检,不能同步");
 
 
 
@@ -834,11 +840,11 @@ namespace Shentun.Peis.TransToWebPeis
                     await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.patient_register(patient_register_id, patient_register_no, patient_id, medical_times, customer_org_id, customer_org_group_id, medical_package_id," +
                         "patient_name,sex_id, birth_date, age, job_card_no, medical_card_no, marital_status_id, medical_type_id, personnel_type_id, job_post, job_title, photo," +
                         " sex_hormone_term_id, interpose_measure, medical_conclusion_id, complete_flag, is_medical_start, medical_start_date, summary_date, is_audit, audit_date, is_vip, third_info,remark,medical_center_id," +
-                        "customer_org_register_id, concurrency_stamp, creation_time, creator_id, last_modification_time, last_modifier_id, audit_doctor_id,summary_doctor_id, his_patient_id,third_register_id,appoint_patient_register_id) VALUES " +
+                        "customer_org_register_id, concurrency_stamp, creation_time, creator_id, last_modification_time, last_modifier_id, audit_doctor_id,summary_doctor_id, his_patient_id,third_register_id) VALUES " +
                         "(@patient_register_id,@patient_register_no,@patient_id,@medical_times,@customer_org_id,@customer_org_group_id::uuid,@medical_package_id::uuid," +
                         "@patient_name,@sex_id,CAST(@birth_date as timestamp),@age,@job_card_no,@medical_card_no,@marital_status_id,@medical_type_id::uuid,@personnel_type_id::uuid,@job_post,@job_title,@photo," +
                         "@sex_hormone_term_id::uuid,@interpose_measure,@medical_conclusion_id::uuid,@complete_flag,@is_medical_start,@medical_start_date,CAST(@summary_date as timestamp),@is_audit,CAST(@audit_date as timestamp),@is_vip,@third_info,@remark,@medical_center_id," +
-                        "@customer_org_register_id,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@audit_doctor_id::uuid,@summary_doctor_id::uuid,@his_patient_id,@third_register_id,@appoint_patient_register_id);",
+                        "@customer_org_register_id,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@audit_doctor_id::uuid,@summary_doctor_id::uuid,@his_patient_id,@third_register_id);",
                         new List() {
                             new SugarParameter("patient_register_id",patientRegisterEnt.Id),
                             new SugarParameter("patient_register_no",patientRegisterEnt.PatientRegisterNo),
@@ -882,8 +888,7 @@ namespace Shentun.Peis.TransToWebPeis
                             new SugarParameter("audit_doctor_id",patientRegisterEnt.AuditDoctorId),
                             new SugarParameter("summary_doctor_id",patientRegisterEnt.SummaryDoctorId),
                             new SugarParameter("his_patient_id",patientRegisterEnt.HisPatientId),
-                            new SugarParameter("third_register_id",third_register_id),
-                            new SugarParameter("appoint_patient_register_id",patientRegisterEnt.AppointPatientRegisterId)
+                            new SugarParameter("third_register_id",third_register_id)
                       });
 
                     #endregion
@@ -904,10 +909,10 @@ namespace Shentun.Peis.TransToWebPeis
                         #region register_check
                         await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.register_check(register_check_id, patient_register_id, check_request_no, third_info, complete_flag, critical_value, critical_value_flag, critical_value_process_content," +
                                    "critical_value_process_flag, critical_value_process_doctor, critical_value_process_date, critical_value_create_date, check_doctor_id, check_date, is_audit," +
-                                   " auditor_user_id, audit_time, concurrency_stamp, creation_time, creator_id, last_modification_time, last_modifier_id, exec_organization_unit_id,is_sign_in,sign_in_person,sign_in_time) VALUES " +
+                                   " auditor_user_id, audit_time, concurrency_stamp, creation_time, creator_id, last_modification_time, last_modifier_id, exec_organization_unit_id) VALUES " +
                                    "(@register_check_id,@patient_register_id,@check_request_no,@third_info,@complete_flag,@critical_value,@critical_value_flag,@critical_value_process_content," +
                                    "@critical_value_process_flag,@critical_value_process_doctor,CAST(@critical_value_process_date as timestamp),CAST(@critical_value_create_date as timestamp),@check_doctor_id,CAST(@check_date as timestamp),@is_audit," +
-                                   "@auditor_user_id::uuid,CAST(@audit_time as timestamp),@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@exec_organization_unit_id::uuid,@is_sign_in,@sign_in_person,@sign_in_time);",
+                                   "@auditor_user_id::uuid,CAST(@audit_time as timestamp),@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@exec_organization_unit_id::uuid);",
                                    new List() {
                                        new SugarParameter("register_check_id",registerCheckWithDetail.Id),
                                        new SugarParameter("patient_register_id",registerCheckWithDetail.PatientRegisterId),
@@ -931,10 +936,7 @@ namespace Shentun.Peis.TransToWebPeis
                                        new SugarParameter("creator_id",registerCheckWithDetail.CreatorId),
                                        new SugarParameter("last_modification_time",registerCheckWithDetail.LastModificationTime),
                                        new SugarParameter("last_modifier_id",registerCheckWithDetail.LastModifierId),
-                                       new SugarParameter("exec_organization_unit_id",registerCheckWithDetail.ExecOrganizationUnitId),
-                                       new SugarParameter("is_sign_in",registerCheckWithDetail.IsSignIn),
-                                       new SugarParameter("sign_in_person",registerCheckWithDetail.SignInPerson),
-                                       new SugarParameter("sign_in_time",registerCheckWithDetail.SignInTime)
+                                       new SugarParameter("exec_organization_unit_id",registerCheckWithDetail.ExecOrganizationUnitId)
                                  });
                         #endregion
 
diff --git a/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrg.cs b/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrg.cs
index 7150313..2074c4b 100644
--- a/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrg.cs
+++ b/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrg.cs
@@ -157,6 +157,13 @@ namespace Shentun.Peis.Models
         public string SalesPersonPhone { get; set; }
 
 
+        /// 
+        /// 单位编码  兼容老系统
+        /// 
+        [Column("customer_org_code")]
+        [StringLength(50)]
+        public string CustomerOrgCode { get; set; }
+
         //[Column("creator_id")]
         //public Guid CreatorId { get; set; }
         //[Column("creation_time", TypeName = "timestamp without time zone")]
diff --git a/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs b/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs
index d30d251..c2cc3d1 100644
--- a/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs
+++ b/src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs
@@ -72,7 +72,7 @@ namespace Shentun.Peis.CustomerOrgs
           CustomerOrg entity
          )
         {
-            if(entity.OrgTypeId == Guid.Empty)
+            if (entity.OrgTypeId == Guid.Empty)
             {
                 entity.OrgTypeId = (await _customerOrgTypeRepository.GetListAsync()).FirstOrDefault().Id;
             }
@@ -206,7 +206,56 @@ namespace Shentun.Peis.CustomerOrgs
         /// 
         public async Task UpdateManySortAsync(Guid id, int SortType)
         {
-            await EntityHelper.UpdateManySortAsync(_repository, id, SortType);
+            var entity = await _repository.GetAsync(id);
+
+            List UptList = new List();
+
+
+            if (SortType == 1)
+            {
+                UptList = (await _repository.GetListAsync(o => o.ParentId == entity.ParentId && o.DisplayOrder > entity.DisplayOrder)).OrderBy(o => o.DisplayOrder).ToList();
+
+                if (UptList.Count > 0)
+                {
+
+                    int indexnum = entity.DisplayOrder;  //原有值
+
+                    entity.DisplayOrder = UptList[UptList.Count - 1].DisplayOrder;  //修改当前排序值为最大  
+
+                    //置顶操作,往上一行开始,逐渐替换
+                    foreach (var item in UptList)
+                    {
+                        int dqnum = item.DisplayOrder;
+                        item.DisplayOrder = indexnum;
+                        indexnum = dqnum;
+                    }
+                }
+            }
+            else
+            {
+                UptList = (await _repository.GetListAsync(o => o.ParentId == entity.ParentId && o.DisplayOrder < entity.DisplayOrder)).OrderByDescending(o => o.DisplayOrder).ToList(); ;
+
+                if (UptList.Count > 0)
+                {
+                    int indexnum = entity.DisplayOrder;  //原有值
+
+                    entity.DisplayOrder = UptList[UptList.Count - 1].DisplayOrder;  //修改当前排序值为最小  
+
+                    //置底操作,往下一行开始,逐渐替换
+                    foreach (var item in UptList)
+                    {
+                        int dqnum = item.DisplayOrder;
+                        item.DisplayOrder = indexnum;
+                        indexnum = dqnum;
+                    }
+                }
+            }
+
+
+            UptList.Add(entity);
+
+
+            await _repository.UpdateManyAsync(UptList);
         }
 
 
diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240605134759_init20240605002.Designer.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240605134759_init20240605002.Designer.cs
new file mode 100644
index 0000000..e21cc9a
--- /dev/null
+++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20240605134759_init20240605002.Designer.cs
@@ -0,0 +1,14969 @@
+// 
+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("20240605134759_init20240605002")]
+    partial class init20240605002
+    {
+        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("AsbitemRoom", b =>
+                {
+                    b.Property("AsbitemId")
+                        .HasColumnType("uuid");
+
+                    b.Property("RoomId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("AsbitemId", "RoomId");
+
+                    b.ToTable("AsbitemRoom");
+                });
+
+            modelBuilder.Entity("RoomAsbitem", b =>
+                {
+                    b.Property("RoomId")
+                        .HasMaxLength(5)
+                        .HasColumnType("uuid")
+                        .HasColumnName("room_id")
+                        .IsFixedLength();
+
+                    b.Property("AsbitemId")
+                        .HasMaxLength(6)
+                        .HasColumnType("uuid")
+                        .HasColumnName("asbitem_id")
+                        .IsFixedLength();
+
+                    b.HasKey("RoomId", "AsbitemId")
+                        .HasName("pk_room_asbitem");
+
+                    b.HasIndex("AsbitemId");
+
+                    b.ToTable("room_asbitem", (string)null);
+
+                    b.HasComment("房间包含组合项目设置");
+                });
+
+            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("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("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("IsDiagnosisFunction")
+                        .ValueGeneratedOnAdd()
+                        .HasMaxLength(1)
+                        .HasColumnType("character(1)")
+                        .HasColumnName("is_diagnosis_function")
+                        .HasDefaultValueSql("'N'")
+                        .HasComment("启用诊断函数");
+
+                    b.Property("IsDisablePregnancy")
+                        .ValueGeneratedOnAdd()
+                        .HasMaxLength(1)
+                        .HasColumnType("character(1)")
+                        .HasColumnName("is_disable_pregnancy")
+                        .HasDefaultValueSql("'N'")
+                        .HasComment("怀孕期间禁止检查");
+
+                    b.Property("IsDisablePreparePregnancy")
+                        .ValueGeneratedOnAdd()
+                        .HasMaxLength(1)
+                        .HasColumnType("character(1)")
+                        .HasColumnName("is_disable_prepare_pregnancy")
+                        .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("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("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(200)
+                        .HasColumnType("character varying(200)")
+                        .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(20)
+                        .HasColumnType("character varying(20)")
+                        .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(20)
+                        .HasColumnType("character varying(20)")
+                        .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("SettleAccountId")
+                        .HasColumnType("uuid")
+                        .HasColumnName("settle_account_id");
+
+                    b.Property("SettleTime")
+                        .HasColumnType("timestamp without time zone")
+                        .HasColumnName("settle_time");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex(new[] { "PatientRegisterId" }, "fki_fk_patient_register_charge");
+
+                    b.HasIndex(new[] { "PatientRegisterId" }, "ix_charge");
+
+                    b.ToTable("charge");
+
+                    b.HasComment("收费主档");
+                });
+
+            modelBuilder.Entity("Shentun.Peis.Models.ChargeAsbitem", b =>
+                {
+                    b.Property("Id")
+                        .HasColumnType("uuid")
+                        .HasColumnName("id");
+
+                    b.Property("Amount")
+                        .HasColumnType("smallint")
+                        .HasColumnName("amount");
+
+                    b.Property("AsbitemId")
+                        .HasColumnType("uuid")
+                        .HasColumnName("asbitem_id")
+                        .IsFixedLength()
+                        .HasComment("组合项目");
+
+                    b.Property("ChargeId")
+                        .HasColumnType("uuid")
+                        .HasColumnName("charge_id")
+                        .HasComment("收据号");
+
+                    b.Property("ChargePrice")
+                        .HasPrecision(10, 2)
+                        .HasColumnType("numeric(10,2)")
+                        .HasColumnName("charge_price")
+                        .HasComment("价格");
+
+                    b.Property("ConcurrencyStamp")
+                        .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