Browse Source

人寿

master
wxd 1 year ago
parent
commit
209e0c5678
  1. 79
      src/Shentun.Peis.Application.Contracts/ThirdBookings/CreateBookingMedicalByExcelInputDto.cs
  2. 16
      src/Shentun.Peis.Application.Contracts/ThirdBookings/GetThirdBookingListDto.cs
  3. 4
      src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
  4. 117
      src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
  5. 8
      src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs

79
src/Shentun.Peis.Application.Contracts/ThirdBookings/CreateBookingMedicalByExcelInputDto.cs

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.ThirdBookings
{
public class CreateBookingMedicalByExcelInputDto
{
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 单位分组ID
/// </summary>
public string CustomerOrgGroupId { get; set; }
/// <summary>
/// 第三方体检中心Id
/// </summary>
public string ThirdMedicalCenterId { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdNo { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexName { get; set; }
/// <summary>
/// 年龄
/// </summary>
public short Age { get; set; }
/// <summary>
/// 预约日期 yyyy-MM-dd
/// </summary>
public string BookingDate { get; set; }
/// <summary>
/// 电话
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 分公司
/// </summary>
public string ChildCompanyName { get; set; }
/// <summary>
/// 部门
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 岗位
/// </summary>
public string PositionName { get; set; }
/// <summary>
/// 是否在职 0:在职,1:退休
/// </summary>
public string EmpStatus { get; set; }
/// <summary>
///婚姻状况 0:未婚、1:已婚
/// </summary>
public string MaritalStatus { get; set; }
}
}

16
src/Shentun.Peis.Application.Contracts/ThirdBookings/GetThirdBookingListDto.cs

@ -58,15 +58,15 @@ namespace Shentun.Peis.ThirdBookings
/// </summary>
public string Phone { get; set; }
///// <summary>
///// 分公司
///// </summary>
//public string ChildCompanyName { get; set; }
/// <summary>
/// 分公司
/// </summary>
public string ChildCompanyName { get; set; }
///// <summary>
///// 部门
///// </summary>
//public string DepartmentName { get; set; }
/// <summary>
/// 部门
/// </summary>
public string DepartmentName { get; set; }
///// <summary>
///// 婚姻状况

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

@ -113,7 +113,7 @@ namespace Shentun.Peis.ThirdBookingPushs
IDTYPE = thirdBookingEnt.IdType,
MOBILE = thirdBookingEnt.Phone,
NAME = patientRegisterEnt.PatientName,
SOURCE = "BjGJ",
SOURCE = "BJGJ",
YEAR = medicalYear
};
@ -201,7 +201,7 @@ namespace Shentun.Peis.ThirdBookingPushs
IDTYPE = thirdBookingEnt.IdType,
MOBILE = thirdBookingEnt.Phone,
NAME = patientRegisterEnt.PatientName,
SOURCE = "BjGJ",
SOURCE = "BJGJ",
YEAR = medicalYear,
AGE = patientRegisterEnt.Age == null ? (short)0 : patientRegisterEnt.Age.Value,
BIRTHDAY = patientRegisterEnt.BirthDate != null ? patientRegisterEnt.BirthDate.Value.ToString("yyyy-MM-dd") : "",

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

@ -105,6 +105,8 @@ namespace Shentun.Peis.ThirdBookings
PatientName = s.PatientName,
Phone = s.Phone,
SexId = GetSexId(s.SexName),
ChildCompanyName = s.ChildCompanyName,
DepartmentName = s.DepartmentName,
CustomerOrgId = GetCustomerOrgId(customerOrgList, customerOrgId, s.ChildCompanyName, s.DepartmentName),
CustomerOrgRegisterId = customerOrgRegisterId,
}).ToList();
@ -114,83 +116,44 @@ namespace Shentun.Peis.ThirdBookings
}
///// <summary>
///// 体检预约接口
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpPost]
//public async Task CreateBookingMedicalByExcelAsync(PublicRequestDto input)
//{
// string inputStr = DataHelper.GetInputDecrypt(input.DATA, input.SIGN);
// if (!string.IsNullOrWhiteSpace(inputStr))
// {
// var inputPara = JsonConvert.DeserializeObject<CreateBookingMedicalInputDto>(inputStr);
// if (inputPara != null)
// {
// string peisAdminId = _configuration.GetSection("PeisAdminId").Value;
// string sourceChannel = "1"; //1 正式环境 0 测试环境
// if (!string.IsNullOrWhiteSpace(_configuration.GetSection("SourceChannel").Value))
// {
// sourceChannel = _configuration.GetSection("SourceChannel").Value;
// }
// Guid id = Guid.NewGuid();
// int isExe = await _peisDb.Ado.ExecuteCommandAsync("INSERT INTO public.third_booking(id,patient_name,customer_org_group_id,third_medical_center_id," +
// "id_type,id_no, sex_name, age, booking_date, phone, child_company_name, department_name, marital_status_name,concurrency_stamp," +
// " creation_time, creator_id, last_modification_time, last_modifier_id, medical_status,icode,source_channel) " +
// "VALUES (@id,@patient_name,@customer_org_group_id,@third_medical_center_id," +
// "@id_type,@id_no,@sex_name,@age,@booking_date,@phone,@child_company_name,@department_name,@marital_status_name,@concurrency_stamp," +
// "@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@medical_status,@icode,@source_channel) ;",
// new List<SugarParameter>() {
// new SugarParameter("id",id),
// new SugarParameter("patient_name",inputPara.name),
// new SugarParameter("customer_org_group_id",inputPara.exampackagecode),
// new SugarParameter("third_medical_center_id",inputPara.examcenterid),
// new SugarParameter("id_type",inputPara.idtype),
// new SugarParameter("id_no",inputPara.idno),
// new SugarParameter("sex_name",inputPara.sex),
// new SugarParameter("age",inputPara.age),
// new SugarParameter("booking_date",Convert.ToDateTime(inputPara.bookingdata)),
// new SugarParameter("phone",inputPara.phone),
// new SugarParameter("child_company_name",""),
// new SugarParameter("department_name",""),
// new SugarParameter("marital_status_name",""),
// new SugarParameter("concurrency_stamp",Guid.NewGuid().ToString("N")),
// new SugarParameter("creation_time",DateTime.Now),
// new SugarParameter("creator_id",Guid.Parse(peisAdminId)),
// new SugarParameter("last_modification_time",DateTime.Now),
// new SugarParameter("last_modifier_id",Guid.Parse(peisAdminId)),
// new SugarParameter("medical_status",'0'),
// new SugarParameter("icode",input.ICODE),
// new SugarParameter("source_channel",sourceChannel)
// });
// if (isExe > 0)
// {
// var resultDto = new CreateBookingMedicalDto
// {
// error = "0",
// error_msg = "成功",
// data = new CreateBookingMedicalDetailDto { bookingid = id.ToString() }
// };
// result = DataHelper.GetResultEncrypt(JsonConvert.SerializeObject(resultDto), input.ICODE);
// }
// }
// }
// return result;
//}
/// <summary>
/// 导入体检预约
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/ThirdBooking/CreateBookingMedicalByExcel")]
public async Task CreateBookingMedicalByExcelAsync(CreateBookingMedicalByExcelInputDto input)
{
if (string.IsNullOrWhiteSpace(input.PatientName))
throw new UserFriendlyException("名字不能为空");
if (string.IsNullOrWhiteSpace(input.BookingDate))
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);
}
/// <summary>

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

@ -11,13 +11,19 @@ using Org.BouncyCastle.Crypto.Tls;
namespace Shentun.Peis.Models
{
/// <summary>
/// 第三方预约人员记录
/// </summary>
[Table("third_booking")]
public class ThirdBooking : AuditedEntity<Guid>, IHasConcurrencyStamp
{
public ThirdBooking() { }
public ThirdBooking(Guid id) : base(id)
{
}
/// <summary>
/// 姓名
/// </summary>

Loading…
Cancel
Save