Browse Source

修改预约

master
wxd 12 months ago
parent
commit
2c587b5671
  1. 142
      src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
  2. 40
      src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
  3. 14
      src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs
  4. 16190
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20241122081824_update_third_booking_add_booking_type_confirm_type.Designer.cs
  5. 37
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20241122081824_update_third_booking_add_booking_type_confirm_type.cs
  6. 10
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  7. 12
      src/Shentun.Peis.HttpApi.Host/appsettings.json

142
src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs

@ -3,18 +3,23 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using NPOI.HPSF;
using NPOI.OpenXmlFormats.Vml;
using NPOI.SS.Formula.Functions;
using NPOI.Util;
using Shentun.Peis.CustomerOrgRegisters;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
using Shentun.Peis.PatientRegisters;
using Shentun.Peis.TransToWebPeis;
using Spire.Pdf.Exporting.XPS.Schema;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Mime;
@ -41,17 +46,22 @@ namespace Shentun.Peis.ThirdBookingPushs
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
private readonly IRepository<ThirdBooking, Guid> _thirdBookingRepository;
private readonly IRepository<CustomerOrgGroup, Guid> _customerOrgGroupRepository;
private readonly IRepository<Patient, Guid> _patientRepository;
private readonly ILogger<ThirdBookingPushAppService> _logger;
public ThirdBookingPushAppService(
IRepository<ThirdInterface, Guid> thirdInterfaceRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository,
IRepository<ThirdBooking, Guid> thirdBookingRepository,
IRepository<CustomerOrgGroup, Guid> customerOrgGroupRepository
)
IRepository<CustomerOrgGroup, Guid> customerOrgGroupRepository,
IRepository<Patient, Guid> patientRepository,
ILogger<ThirdBookingPushAppService> logger)
{
_thirdInterfaceRepository = thirdInterfaceRepository;
_patientRegisterRepository = patientRegisterRepository;
_thirdBookingRepository = thirdBookingRepository;
_customerOrgGroupRepository = customerOrgGroupRepository;
_patientRepository = patientRepository;
_logger = logger;
}
/// <summary>
@ -105,12 +115,12 @@ namespace Shentun.Peis.ThirdBookingPushs
BOOKINGDATEDESC = "",
BOOKINGID = patientRegisterEnt.ThirdBookingId,
BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
BOOKINGTYPE = "1",
BOOKINGTYPE = thirdBookingEnt.BookingType,
BOOKINGTYPEELSEDESC = "",
CONFIRMORG = "MINZ",
CONFIRMORGCENTERDESC = "民众",
CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
CONFIRMTYPE = "1",
CONFIRMTYPE = thirdBookingEnt.ConfirmType,
EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
IDNO = thirdBookingEnt.IdNo,
@ -202,12 +212,12 @@ namespace Shentun.Peis.ThirdBookingPushs
BOOKINGDATEDESC = "",
BOOKINGID = patientRegisterEnt.ThirdBookingId,
BOOKINGTIME = thirdBookingEnt.BookingDate.ToString("HH:mm:ss"),
BOOKINGTYPE = "1",
BOOKINGTYPE = thirdBookingEnt.BookingType,
BOOKINGTYPEELSEDESC = "",
CONFIRMORG = "MINZ",
CONFIRMORGCENTERDESC = "民众",
CONFIRMTIME = patientRegisterEnt.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
CONFIRMTYPE = "1",
CONFIRMTYPE = thirdBookingEnt.ConfirmType,
EXAMPACKAGECODE = thirdBookingEnt.CustomerOrgGroupId,
EXAMPACKAGEDESC = customerOrgGroupEnt.DisplayName,
IDNO = thirdBookingEnt.IdNo,
@ -234,7 +244,7 @@ namespace Shentun.Peis.ThirdBookingPushs
if (decryptDataPara.STATUS == 0)
{
thirdBookingEnt.MedicalStatus = '2';
await _thirdBookingRepository.UpdateAsync(thirdBookingEnt);
await _thirdBookingRepository.UpdateAsync(thirdBookingEnt, true);
}
else
{
@ -354,7 +364,7 @@ namespace Shentun.Peis.ThirdBookingPushs
if (decryptDataPara.FLAG == true)
{
thirdBookingEnt.MedicalStatus = '3';
await _thirdBookingRepository.UpdateAsync(thirdBookingEnt);
await _thirdBookingRepository.UpdateAsync(thirdBookingEnt, true);
}
else
{
@ -573,5 +583,121 @@ namespace Shentun.Peis.ThirdBookingPushs
return SexName;
}
/// <summary>
/// 同步人工导入的预约Id,绑定到登记的人身上
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/ThirdBookingPush/SyncThirdBookingToPatientRegister")]
public async Task SyncThirdBookingToPatientRegisterAsync(CustomerOrgRegisterIdInputDto input)
{
var patientRegisterList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
where patientRegister.CustomerOrgRegisterId == input.CustomerOrgRegisterId
&& string.IsNullOrWhiteSpace(patientRegister.ThirdBookingId)
select new
{
patientRegister,
patient.IdNo
}).ToList();
var thirdBookingList = await _thirdBookingRepository.GetListAsync(m => m.MedicalStatus == '0');
foreach (var item in patientRegisterList)
{
var thirdBookingEnt = thirdBookingList.FirstOrDefault(f => f.PatientName == item.patientRegister.PatientName && f.IdNo == item.IdNo);
if (thirdBookingEnt != null)
{
item.patientRegister.ThirdBookingId = thirdBookingEnt.Id.ToString();
await _patientRegisterRepository.UpdateAsync(item.patientRegister);
_logger.LogInformation($"-----同步预约到登记成功,姓名:{item.patientRegister.PatientName},身份证号:{item.IdNo},登记ID为:{item.patientRegister.Id},预约ID为:{thirdBookingEnt.Id}");
}
}
}
/// <summary>
/// 临时手动推送确认登记 到人寿
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/ThirdBookingPush/PushMedicalRegister")]
public async Task PushMedicalRegisterAsync(CustomerOrgRegisterIdInputDto input)
{
var patientRegisterList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
join thirdBooking in await _thirdBookingRepository.GetQueryableAsync() on patientRegister.ThirdBookingId equals thirdBooking.Id.ToString()
where patientRegister.CustomerOrgRegisterId == input.CustomerOrgRegisterId
&& thirdBooking.MedicalStatus == '0'
select new
{
patientRegister,
thirdBooking
}).ToList();
foreach (var item in patientRegisterList)
{
try
{
//推送到店登记
await PushRegisterAsync(new PatientRegisterIdInputDto
{
PatientRegisterId = item.patientRegister.Id
});
}
catch (Exception ex) {
_logger.LogInformation($"-----推送到店登记异常:{ex.Message}");
}
_logger.LogInformation($"-----推送到店登记成功,姓名:{item.patientRegister.PatientName},登记ID为:{item.patientRegister.Id}");
}
}
/// <summary>
/// 临时手动推送体检完成 到人寿
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/ThirdBookingPush/PushMedicalComplate")]
public async Task PushMedicalComplateAsync(CustomerOrgRegisterIdInputDto input)
{
var patientRegisterList = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
join thirdBooking in await _thirdBookingRepository.GetQueryableAsync() on patientRegister.ThirdBookingId equals thirdBooking.Id.ToString()
where patientRegister.CustomerOrgRegisterId == input.CustomerOrgRegisterId
&& thirdBooking.MedicalStatus == '1'
select new
{
patientRegister,
thirdBooking
}).ToList();
foreach (var item in patientRegisterList)
{
try
{
//推送体检完成
await PushCompletePhysicalAsync(new PatientRegisterIdInputDto
{
PatientRegisterId = item.patientRegister.Id
});
}
catch(Exception ex) {
_logger.LogInformation($"-----推送体检完成异常:{ex.Message}");
}
_logger.LogInformation($"-----推送体检完成成功,姓名:{item.patientRegister.PatientName},,登记ID为:{item.patientRegister.Id}");
}
}
}
}

40
src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs

@ -145,25 +145,27 @@ namespace Shentun.Peis.ThirdBookings
}
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
};
{
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",
BookingType = "4",
ConfirmType = "2",
ThirdMedicalCenterId = input.ThirdMedicalCenterId
};
await _thirdBookingRepository.InsertAsync(thirdBookingEnt);

14
src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs

@ -139,6 +139,20 @@ namespace Shentun.Peis.Models
[StringLength(1)]
public string SourceChannel { get; set; }
/// <summary>
/// 预约类型 1 线上预约 2 电话预约 3 门店预约 4 团体(上门)预约 5 其它
/// </summary>
[Column("booking_type")]
[StringLength(1)]
public string BookingType { get; set; }
/// <summary>
/// 到检方式 1 到店体检 2 团体(上门)体检
/// </summary>
[Column("confirm_type")]
[StringLength(1)]
public string ConfirmType { get; set; }
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }

16190
src/Shentun.Peis.EntityFrameworkCore/Migrations/20241122081824_update_third_booking_add_booking_type_confirm_type.Designer.cs
File diff suppressed because it is too large
View File

37
src/Shentun.Peis.EntityFrameworkCore/Migrations/20241122081824_update_third_booking_add_booking_type_confirm_type.cs

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class update_third_booking_add_booking_type_confirm_type : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "booking_type",
table: "third_booking",
type: "character varying(1)",
maxLength: 1,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "confirm_type",
table: "third_booking",
type: "character varying(1)",
maxLength: 1,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "booking_type",
table: "third_booking");
migrationBuilder.DropColumn(
name: "confirm_type",
table: "third_booking");
}
}
}

10
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -11830,6 +11830,11 @@ namespace Shentun.Peis.Migrations
.HasColumnName("booking_date")
.HasComment("预约日期");
b.Property<string>("BookingType")
.HasMaxLength(1)
.HasColumnType("character varying(1)")
.HasColumnName("booking_type");
b.Property<string>("ChildCompanyName")
.HasMaxLength(100)
.HasColumnType("character varying(100)")
@ -11842,6 +11847,11 @@ namespace Shentun.Peis.Migrations
.HasColumnType("character varying(40)")
.HasColumnName("concurrency_stamp");
b.Property<string>("ConfirmType")
.HasMaxLength(1)
.HasColumnType("character varying(1)")
.HasColumnName("confirm_type");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("creation_time");

12
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -5,16 +5,16 @@
"CorsOrigins": "https://*.Peis.com,http://localhost:4200,http://localhost:9530,http://192.168.1.108:9530,http://localhost:8080,http://localhost:8081",
"RedirectAllowedUrls": "http://localhost:9530",
"SelfUser": "admin",
"SelfPassword": "Shentun!@#qwe123",
// "SelfPassword": "666666",
//"SelfPassword": "Shentun!@#qwe123",
"SelfPassword": "666666",
"LisUser": "admin",
"LisPassword": "Shentun!@#qwe123"
// "LisPassword": "666666"
//"LisPassword": "Shentun!@#qwe123"
"LisPassword": "666666"
},
"ConnectionStrings": {
//"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
//"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
},
"AuthServer": {
"Authority": "http://localhost:9530",

Loading…
Cancel
Save