diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 1096399..f781ab7 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -131,6 +131,7 @@ namespace Shentun.Peis.PatientRegisters private readonly PatientPoisonManager _patientPoisonManager; private readonly IRepository _diagnosisRepository; private readonly ThirdBookingPushAppService _thirdBookingPushAppService; + private readonly IRepository _thirdBookingRepository; public PatientRegisterAppService( IRepository repository, IRepository patientRepository, @@ -191,7 +192,8 @@ namespace Shentun.Peis.PatientRegisters IRepository patientPoisonRepository, PatientPoisonManager patientPoisonManager, IRepository diagnosisRepository, - ThirdBookingPushAppService thirdBookingPushAppService) + ThirdBookingPushAppService thirdBookingPushAppService, + IRepository thirdBookingRepository) : base(repository) { this._repository = repository; @@ -254,6 +256,7 @@ namespace Shentun.Peis.PatientRegisters _patientPoisonManager = patientPoisonManager; _diagnosisRepository = diagnosisRepository; _thirdBookingPushAppService = thirdBookingPushAppService; + _thirdBookingRepository = thirdBookingRepository; } /// /// 获取通过主键 @@ -2223,10 +2226,10 @@ namespace Shentun.Peis.PatientRegisters { _logger.LogError($"推送人寿完成体检=》{ex.Message}"); } - + } - + #endregion return ObjectMapper.Map(newentity); } @@ -2659,7 +2662,10 @@ namespace Shentun.Peis.PatientRegisters var customerOrgRegisterId = interfaceConfig.GetSection("Interface").GetSection("CustomerOrgRegisterId").Value; if (customerOrgRegisterId == input.CustomerOrgRegisterId.ToString()) { - patientRegister.ThirdBookingId = patientRegister.Id.ToString(); + var thirdBookingEnt = await _thirdBookingRepository.FirstOrDefaultAsync(f => f.PatientName == input.PatientName + && f.IdNo == input.IdNo + && (f.Phone == input.MobileTelephone || f.Phone == input.Telephone)); + patientRegister.ThirdBookingId = thirdBookingEnt.Id.ToString(); } } diff --git a/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs b/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs index b9a929d..dc7acfd 100644 --- a/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs +++ b/src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs @@ -7,6 +7,7 @@ using Microsoft.Net.Http.Headers; using Newtonsoft.Json; using NPOI.HPSF; using NPOI.SS.Formula.Functions; +using NPOI.Util; using Shentun.Peis.Enums; using Shentun.Peis.Models; using Shentun.Peis.PatientRegisters; @@ -75,6 +76,7 @@ namespace Shentun.Peis.ThirdBookingPushs var privateKey = interfaceConfig.GetSection("Interface").GetSection("MinZhongPrivateKey").Value; var medicalYear = interfaceConfig.GetSection("Interface").GetSection("MedicalYear").Value; var isActive = interfaceConfig.GetSection("Interface").GetSection("IsActive").Value; + //var customerOrgRegisterId = interfaceConfig.GetSection("Interface").GetSection("CustomerOrgRegisterId").Value; var iCode = interfaceConfig.GetSection("Interface").GetSection("ICODE").Value; if (!string.IsNullOrWhiteSpace(isActive) && isActive == "Y") diff --git a/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs b/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs index a621c42..6dd51f0 100644 --- a/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs +++ b/src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs @@ -130,26 +130,40 @@ namespace Shentun.Peis.ThirdBookings if (string.IsNullOrWhiteSpace(input.BookingDate)) throw new UserFriendlyException("日期不能为空"); - var thirdBookingEnt = new ThirdBooking(GuidGenerator.Create()) + if (!string.IsNullOrWhiteSpace(input.MaritalStatus) + && input.MaritalStatus != "0" + && input.MaritalStatus != "1") + { + throw new UserFriendlyException("婚姻状况格式不正确"); + } + + if (!string.IsNullOrWhiteSpace(input.EmpStatus) + && input.EmpStatus != "0" + && input.EmpStatus != "1") { - Age = input.Age, - BookingDate = Convert.ToDateTime(input.BookingDate), - ChildCompanyName = input.ChildCompanyName, - CustomerOrgGroupId = input.CustomerOrgGroupId, - DepartmentName = input.DepartmentName, - EmpStatus = input.EmpStatus, - ICode = "", - IdNo = input.IdNo, - IdType = "0", - MaritalStatus = input.MaritalStatus, - MedicalStatus = '0', - PatientName = input.PatientName, - Phone = input.Phone, - PositionName = input.PositionName, - SexName = input.SexName, - SourceChannel = "1", - ThirdMedicalCenterId = input.ThirdMedicalCenterId - }; + throw new UserFriendlyException("是否在职格式不正确"); + } + + var thirdBookingEnt = new ThirdBooking(GuidGenerator.Create()) + { + Age = input.Age, + BookingDate = Convert.ToDateTime(input.BookingDate), + ChildCompanyName = input.ChildCompanyName, + CustomerOrgGroupId = input.CustomerOrgGroupId, + DepartmentName = input.DepartmentName, + EmpStatus = input.EmpStatus, + ICode = "", + IdNo = input.IdNo, + IdType = "0", + MaritalStatus = input.MaritalStatus, + MedicalStatus = '0', + PatientName = input.PatientName, + Phone = input.Phone, + PositionName = input.PositionName, + SexName = input.SexName, + SourceChannel = "1", + ThirdMedicalCenterId = input.ThirdMedicalCenterId + }; await _thirdBookingRepository.InsertAsync(thirdBookingEnt);