From 92026426f373b608e9d37b033a1ac2b4c2db8f53 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Thu, 20 Nov 2025 10:35:03 +0800
Subject: [PATCH] =?UTF-8?q?id=E8=BD=AC=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../CCTJExportDataAppService.cs | 94 ++++++++++++-------
.../CCTJExportDatas/CCTJLMPAppService.cs | 19 ++--
2 files changed, 71 insertions(+), 42 deletions(-)
diff --git a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs
index f0aa44c..00f91bc 100644
--- a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs
+++ b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs
@@ -631,7 +631,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid deviceTypeId = GuidGenerator.Create();
+ // Guid deviceTypeId = GuidGenerator.Create();
+ Guid deviceTypeId = StringConvertGuidHelper.GenerateURLUUID(row["device_type_id"].ToString());
var data = new DeviceType(deviceTypeId)
{
@@ -684,7 +685,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid unitId = GuidGenerator.Create();
+ //Guid unitId = GuidGenerator.Create();
+ Guid unitId = StringConvertGuidHelper.GenerateURLUUID(row["unit_id"].ToString());
var data = new Unit(unitId)
{
DisplayName = row["unit_name"].ToString(),
@@ -737,7 +739,9 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid medicalTypeId = GuidGenerator.Create();
+ //Guid medicalTypeId = GuidGenerator.Create();
+ Guid medicalTypeId = StringConvertGuidHelper.GenerateURLUUID(row["medical_type_id"].ToString());
+
var data = new MedicalType(medicalTypeId)
{
DisplayName = row["medical_type_name"].ToString(),
@@ -793,7 +797,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid personnelTypeId = GuidGenerator.Create();
+ //Guid personnelTypeId = GuidGenerator.Create();
+ Guid personnelTypeId = StringConvertGuidHelper.GenerateURLUUID(row["personnel_type_id"].ToString());
var data = new PersonnelType(personnelTypeId)
{
@@ -849,7 +854,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid invoiceItemTypeId = GuidGenerator.Create();
+ // Guid invoiceItemTypeId = GuidGenerator.Create();
+ Guid invoiceItemTypeId = StringConvertGuidHelper.GenerateURLUUID(row["invoice_item_type_id"].ToString());
var data = new InvoiceItemType(invoiceItemTypeId)
{
@@ -903,8 +909,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid collectItemTypeId = GuidGenerator.Create();
-
+ // Guid collectItemTypeId = GuidGenerator.Create();
+ Guid collectItemTypeId = StringConvertGuidHelper.GenerateURLUUID(row["collect_item_type_id"].ToString());
Guid invoiceItemTypeId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "invoice_item_type" && m.OldKeyValue == row["invoice_item_type_id"].ToString()).FirstOrDefault().NewKeyValue);
@@ -960,7 +966,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid itemTypeId = GuidGenerator.Create();
+ //Guid itemTypeId = GuidGenerator.Create();
+ Guid itemTypeId = StringConvertGuidHelper.GenerateURLUUID(row["department_id"].ToString());
var data = new ItemType(itemTypeId)
{
@@ -1023,7 +1030,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid sampleTypeId = GuidGenerator.Create();
+ //Guid sampleTypeId = GuidGenerator.Create();
+ Guid sampleTypeId = StringConvertGuidHelper.GenerateURLUUID(row["specimen_type_id"].ToString());
var data = new SampleType(sampleTypeId)
{
@@ -1131,7 +1139,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid medicalConclusionId = GuidGenerator.Create();
+ // Guid medicalConclusionId = GuidGenerator.Create();
+ Guid medicalConclusionId = StringConvertGuidHelper.GenerateURLUUID(row["medical_conclusion_id"].ToString());
var data = new MedicalConclusion(medicalConclusionId)
{
@@ -1318,7 +1327,8 @@ namespace Shentun.Peis.CCTJExportDatas
if (!string.IsNullOrWhiteSpace(row["unit_id"].ToString()))
unitId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "unit" && m.OldKeyValue == row["unit_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid itemId = GuidGenerator.Create();
+ // Guid itemId = GuidGenerator.Create();
+ Guid itemId = StringConvertGuidHelper.GenerateURLUUID(row["item_id"].ToString());
var data = new Item(itemId)
{
@@ -1471,8 +1481,8 @@ namespace Shentun.Peis.CCTJExportDatas
Guid collectItemTypeId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "collect_item_type" && m.OldKeyValue == row["collect_item_type_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid asbitemId = GuidGenerator.Create();
-
+ // Guid asbitemId = GuidGenerator.Create();
+ Guid asbitemId = StringConvertGuidHelper.GenerateURLUUID(row["asbitem_id"].ToString());
var data = new Asbitem(asbitemId)
{
@@ -1616,7 +1626,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid medicalPackageId = GuidGenerator.Create();
+ // Guid medicalPackageId = GuidGenerator.Create();
+ Guid medicalPackageId = StringConvertGuidHelper.GenerateURLUUID(row["medical_package_id"].ToString());
var data = new MedicalPackage(medicalPackageId)
{
@@ -1782,7 +1793,8 @@ namespace Shentun.Peis.CCTJExportDatas
#endregion
- Guid diagnosisId = GuidGenerator.Create();
+ //Guid diagnosisId = GuidGenerator.Create();
+ Guid diagnosisId = StringConvertGuidHelper.GenerateURLUUID(row["diagnosis_id"].ToString());
var data = new Diagnosis(diagnosisId)
{
@@ -1848,7 +1860,8 @@ namespace Shentun.Peis.CCTJExportDatas
Guid DiagnosisId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "diagnosis" && m.OldKeyValue == row["diagnosis_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid suggestionId = GuidGenerator.Create();
+ // Guid suggestionId = GuidGenerator.Create();
+ Guid suggestionId = StringConvertGuidHelper.GenerateURLUUID(row["suggestion_id"].ToString());
if (await _suggestionRepository.FirstOrDefaultAsync(f => f.DiagnosisId == DiagnosisId && f.SuggestionContent == row["suggestion_content"].ToString()) == null)
{
@@ -1914,7 +1927,8 @@ namespace Shentun.Peis.CCTJExportDatas
Guid ItemId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "item" && m.OldKeyValue == row["item_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid itemResultTemplateId = GuidGenerator.Create();
+ //Guid itemResultTemplateId = GuidGenerator.Create();
+ Guid itemResultTemplateId = StringConvertGuidHelper.GenerateURLUUID(row["item_result_template_id"].ToString());
if (await _itemResultTemplateRepository.FirstOrDefaultAsync(f => f.ItemId == ItemId && f.Result == row["result"].ToString()) == null)
{
@@ -1981,8 +1995,8 @@ namespace Shentun.Peis.CCTJExportDatas
Guid DiagnosisId = Guid.Parse(fieldComparisonDiagnosisEnt.NewKeyValue);
Guid ItemId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "item" && m.OldKeyValue == row["item_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid itemResultMatchId = GuidGenerator.Create();
-
+ // Guid itemResultMatchId = GuidGenerator.Create();
+ Guid itemResultMatchId = StringConvertGuidHelper.GenerateURLUUID(row["item_result_match_id"].ToString());
var data = new ItemResultMatch(itemResultMatchId)
{
DisplayOrder = oldItemResultMatchList.Rows.IndexOf(row) + 1,
@@ -2131,8 +2145,8 @@ namespace Shentun.Peis.CCTJExportDatas
}
#endregion
- Guid sampleGroupId = GuidGenerator.Create();
-
+ // Guid sampleGroupId = GuidGenerator.Create();
+ Guid sampleGroupId = StringConvertGuidHelper.GenerateURLUUID(row["vessels_type_id"].ToString());
var data = new SampleGroup(sampleGroupId)
{
DisplayName = row["vessels_type_name"].ToString(),
@@ -2244,7 +2258,9 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid customerOrgId = GuidGenerator.Create();
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
+
if (row["org_id"].ToString() == "00000")
{
@@ -2368,8 +2384,8 @@ namespace Shentun.Peis.CCTJExportDatas
#endregion
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
#region 转换体检类别ID
@@ -2486,8 +2502,8 @@ namespace Shentun.Peis.CCTJExportDatas
#endregion
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
#region 备注 导入联系人姓名、电话
string remark = "";
if (!string.IsNullOrWhiteSpace(row["linkman"].ToString()))
@@ -2604,8 +2620,8 @@ namespace Shentun.Peis.CCTJExportDatas
#endregion
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
#region 备注 导入联系人姓名、电话
string remark = "";
if (!string.IsNullOrWhiteSpace(row["linkman"].ToString()))
@@ -2763,8 +2779,9 @@ namespace Shentun.Peis.CCTJExportDatas
Guid customerOrgId = Guid.Parse(fieldComparisonList.Where(m => m.OldKeyValue == row["org_id"].ToString()).FirstOrDefault().NewKeyValue);
Guid customerOrgRegisterId = customerOrgRegisterList.Where(m => m.CustomerOrgId == customerOrgId
&& m.MedicalTimes == (short)Convert.ToInt32(row["org_medical_times"].ToString())).FirstOrDefault().Id;
- Guid customerOrgGroupId = GuidGenerator.Create();
+ // Guid customerOrgGroupId = GuidGenerator.Create();
+ Guid customerOrgGroupId = StringConvertGuidHelper.GenerateURLUUID(row["org_group_id"].ToString());
var data = new CustomerOrgGroup(customerOrgGroupId)
{
AgeLowerLimit = (short)Convert.ToInt32(row["age_lower_limit"].ToString()),
@@ -3068,6 +3085,14 @@ namespace Shentun.Peis.CCTJExportDatas
}
+
+ ///
+ /// 人员数据导入主方法
+ ///
+ ///
+ ///
+ ///
+ ///
private async Task ImportSingle(List customerOrgRegisterList, List userList, DataRow row)
{
try
@@ -3082,8 +3107,8 @@ namespace Shentun.Peis.CCTJExportDatas
string oldPatientRegisterId = row["patient_register_id"].ToString();
string barcodeNo = row["barcode_no"].ToString();
//检查是否已经导入
- var patRegisterLis = await _patientRegisterRepository.GetListAsync(o => o.PatientRegisterNo == barcodeNo);
- if (patRegisterLis.Count > 0)
+ var patRegisterLis = await _patientRegisterRepository.FirstOrDefaultAsync(o => o.PatientRegisterNo == barcodeNo);
+ if (patRegisterLis != null)
{
return;
}
@@ -3122,7 +3147,9 @@ namespace Shentun.Peis.CCTJExportDatas
}
}
- Guid autoPatientId = GuidGenerator.Create(); //档案ID
+ // Guid autoPatientId = GuidGenerator.Create(); //档案ID
+ Guid autoPatientId = StringConvertGuidHelper.GenerateURLUUID(row["patient_id"].ToString());
+
var dataPatient = new Patient(autoPatientId)
{
Address = row["address"].ToString(),
@@ -3156,7 +3183,8 @@ namespace Shentun.Peis.CCTJExportDatas
- Guid patientRegisterId = GuidGenerator.Create(); //生成登记ID
+ //Guid patientRegisterId = GuidGenerator.Create(); //生成登记ID
+ Guid patientRegisterId = StringConvertGuidHelper.GenerateURLUUID(row["patient_register_id"].ToString());
#region 转换审核医生ID
Guid? AuditDoctorId = null;
diff --git a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs
index 5194621..a242782 100644
--- a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs
+++ b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs
@@ -172,7 +172,8 @@ namespace Shentun.Peis.CCTJExportDatas
if (!string.IsNullOrWhiteSpace(row["unit_id"].ToString()))
unitId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "unit" && m.OldKeyValue == row["unit_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid itemId = GuidGenerator.Create();
+ //Guid itemId = GuidGenerator.Create();
+ Guid itemId = StringConvertGuidHelper.GenerateURLUUID(row["item_id"].ToString());
var data = new Item(itemId)
{
@@ -334,8 +335,8 @@ namespace Shentun.Peis.CCTJExportDatas
Guid collectItemTypeId = Guid.Parse((await _fieldComparisonRepository.GetQueryableAsync()).Where(m => m.TableName == "collect_item_type" && m.OldKeyValue == row["collect_item_type_id"].ToString()).FirstOrDefault().NewKeyValue);
- Guid asbitemId = GuidGenerator.Create();
-
+ //Guid asbitemId = GuidGenerator.Create();
+ Guid asbitemId = StringConvertGuidHelper.GenerateURLUUID(row["asbitem_id"].ToString());
var data = new Asbitem(asbitemId)
{
@@ -444,8 +445,8 @@ namespace Shentun.Peis.CCTJExportDatas
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
if (row["org_id"].ToString() == "00000")
{
customerOrgId = Guid.Parse("00000000-0000-0000-0000-000000000001");
@@ -566,8 +567,8 @@ namespace Shentun.Peis.CCTJExportDatas
var isCZ = await _customerOrgRepository.FirstOrDefaultAsync(f => f.ParentId == parentId && f.DisplayName == row["org_name"].ToString());
if (isCZ == null)
{
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
#region 备注 导入联系人姓名、电话
string remark = "";
if (!string.IsNullOrWhiteSpace(row["linkman"].ToString()))
@@ -684,8 +685,8 @@ namespace Shentun.Peis.CCTJExportDatas
var isCZ = await _customerOrgRepository.FirstOrDefaultAsync(f => f.ParentId == parentId && f.DisplayName == row["org_name"].ToString());
if (isCZ == null)
{
- Guid customerOrgId = GuidGenerator.Create();
-
+ // Guid customerOrgId = GuidGenerator.Create();
+ Guid customerOrgId = StringConvertGuidHelper.GenerateURLUUID(row["org_id"].ToString());
#region 备注 导入联系人姓名、电话
string remark = "";
if (!string.IsNullOrWhiteSpace(row["linkman"].ToString()))