Browse Source

修改人员信息

master
wxd 1 year ago
parent
commit
09da63542e
  1. 33
      src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterBaseInfoByPatientRegisterIdInputDto.cs
  2. 50
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

33
src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterBaseInfoByPatientRegisterIdInputDto.cs

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.PatientRegisters
{
public class UpdatePatientRegisterBaseInfoByPatientRegisterIdInputDto
{
/// <summary>
/// 人员登记ID
/// </summary>
public Guid PatientRegisterId { get; set;}
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set;}
/// <summary>
/// 手机
/// </summary>
public string MobileTelephone { get; set; }
/// <summary>
/// 身份证号
/// </summary>
public string IdNo { get; set; }
}
}

50
src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

@ -43,6 +43,7 @@ using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
@ -3563,6 +3564,55 @@ namespace Shentun.Peis.PatientRegisters
}
#endregion
/// <summary>
/// 修改人员 手机、姓名、身份证 已总检特殊情况修改
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("api/app/PatientRegister/UpdatePatientRegisterBaseInfoByPatientRegisterId")]
public async Task<PatientRegisterOrNoDto> UpdatePatientRegisterBaseInfoByPatientRegisterIdAsync(UpdatePatientRegisterBaseInfoByPatientRegisterIdInputDto input)
{
PatientRegisterOrNoDto msg = new PatientRegisterOrNoDto();
if (input == null ||
string.IsNullOrWhiteSpace(input.IdNo)
&& string.IsNullOrWhiteSpace(input.PatientName)
&& string.IsNullOrWhiteSpace(input.MobileTelephone))
throw new UserFriendlyException("请求参数有误");
var patientRegisterEnt = await _repository.FirstOrDefaultAsync(f => f.Id == input.PatientRegisterId);
if (patientRegisterEnt == null)
{
throw new UserFriendlyException("人员ID不正确");
}
var patientEnt = await _patientRepository.FirstOrDefaultAsync(f => f.Id == patientRegisterEnt.PatientId);
if (patientEnt != null)
{
if (!string.IsNullOrWhiteSpace(input.PatientName))
{
patientEnt.DisplayName = input.PatientName;
patientRegisterEnt.PatientName = input.PatientName;
}
if (!string.IsNullOrWhiteSpace(input.IdNo))
{
patientEnt.IdNo = input.IdNo;
}
if (!string.IsNullOrWhiteSpace(input.MobileTelephone))
{
patientEnt.MobileTelephone = input.MobileTelephone;
}
await _patientRepository.UpdateAsync(patientEnt, true);
await _repository.UpdateAsync(patientRegisterEnt, true);
}
msg = await GetPatientRegisterOrNo(patientRegisterEnt.Id);
return msg;
}
private async Task UpdateRegisterChecks(CreateRegisterCheckAsbitemEntity createRegisterCheckAsbitemEntity)
{
if (createRegisterCheckAsbitemEntity == null)

Loading…
Cancel
Save