Browse Source

人员预约

master
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
cd59396e8e
  1. 5
      src/Shentun.WebPeis.Application.Contracts/AppointPatientRegisters/CreateAppointPatientRegisterDto.cs
  2. 28
      src/Shentun.WebPeis.Application.Contracts/AppointRegisterAsbitems/CreateAppointRegisterAsbitemDto.cs
  3. 10
      src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs
  4. 4
      src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs
  5. 23
      src/Shentun.WebPeis.Domain.Shared/Enums/PayModeFlag.cs
  6. 20
      src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs
  7. 2
      src/Shentun.WebPeis.Domain/Models/AppointPatientRegister.cs

5
src/Shentun.WebPeis.Application.Contracts/AppointPatientRegisters/CreateAppointPatientRegisterDto.cs

@ -1,4 +1,5 @@
using System;
using Shentun.WebPeis.AppointRegisterAsbitems;
using System;
using System.Collections.Generic;
using System.Text;
@ -31,5 +32,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
public decimal? Height { get; set; }
public decimal? Weight { get; set; }
public List<CreateAppointRegisterAsbitemDto> AppointRegisterAsbitems { get; set; } = new List<CreateAppointRegisterAsbitemDto>();
}
}

28
src/Shentun.WebPeis.Application.Contracts/AppointRegisterAsbitems/CreateAppointRegisterAsbitemDto.cs

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.WebPeis.AppointRegisterAsbitems
{
public class CreateAppointRegisterAsbitemDto
{
public Guid AppointRegisterAsbitemId { get; set; }
public Guid AsbitemId { get; set; }
public Guid AppointPatientRegisterId { get; set; }
public decimal StandardPrice { get; set; }
public decimal ChargePrice { get; set; }
public char PayTypeFlag { get; set; }
public char IsCharge { get; set; }
public short Amount { get; set; }
}
}

10
src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs

@ -20,26 +20,26 @@ namespace Shentun.WebPeis.AppointPatientRegisters
{
private readonly IRepository<AppointPatientRegister> _repository;
private readonly IRepository<ItemType> _itemTypeRepository;
private readonly IRepository<DiseaseScreeningType> _diseaseScreeningTypeRepository;
private readonly CacheService _cacheService;
private readonly AppointPatientRegisterManager _appointPatientRegisterManager;
public AppointPatientRegisterAppService(IRepository<AppointPatientRegister> repository,
CacheService cacheService,
IRepository<ItemType> itemTypeRepository,
IRepository<DiseaseScreeningType> diseaseScreeningTypeRepository
AppointPatientRegisterManager appointPatientRegisterManager
)
{
_repository = repository;
_cacheService = cacheService;
_itemTypeRepository = itemTypeRepository;
_diseaseScreeningTypeRepository = diseaseScreeningTypeRepository;
_appointPatientRegisterManager = appointPatientRegisterManager;
}
[HttpPost("api/app/AppointPatientRegister/Create")]
public async Task CreateAsync(CreateAppointPatientRegisterDto input)
{
var entity = ObjectMapper.Map<CreateAppointPatientRegisterDto, AppointPatientRegister>(input);
entity = await _appointPatientRegisterManager.CreateAsync(entity);
}
}
}

4
src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs

@ -56,8 +56,8 @@ public class WebPeisApplicationAutoMapperProfile : Profile
CreateMap<UpdateKinshipDto, Kinship>();
CreateMap<Kinship, KinshipDto>();
CreateMap<CreateAppointPatientRegisterDto, Kinship>();
CreateMap<Kinship, AppointPatientRegisterDto>();
CreateMap<CreateAppointPatientRegisterDto, AppointPatientRegister>();
CreateMap<AppointPatientRegister, AppointPatientRegisterDto>();
}
}

23
src/Shentun.WebPeis.Domain.Shared/Enums/PayModeFlag.cs

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace Shentun.WebPeis.Enums
{
public class PayModeFlag
{
[Description("现金")] public const string Cash = "01";
[Description("银行卡")] public const string BankCard = "02";
[Description("支票")] public const string Cheque = "03";
[Description("记账")] public const string Bill = "04";
[Description("充值卡")] public const string RechargeCard = "05";
[Description("医保卡")] public const string InsurancePay = "06";
[Description("微信")] public const string WeChatPay = "07";
[Description("支付宝")] public const string AliPay = "08";
[Description("京东支付")] public const string JdPay = "09";
[Description("聚合支付")] public const string PolymerizationPay = "10";
[Description("军保统筹")] public const string ArmyPay = "11";
[Description("工行融E联")] public const string Icbc = "12";
}
}

20
src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs

@ -126,6 +126,26 @@ namespace Shentun.WebPeis.AppointPatientRegisters
// throw new UserFriendlyException("登记单位和登记单位体检次数不一致");
// }
//}
if(entity.AppointRegisterAsbitems == null || !entity.AppointRegisterAsbitems.Any())
{
throw new UserFriendlyException("必须预约组合项目");
}
foreach (var appointRegisterAsbitem in entity.AppointRegisterAsbitems)
{
if(appointRegisterAsbitem.ChargePrice < 0)
{
throw new UserFriendlyException("价格不能小于0");
}
if (appointRegisterAsbitem.ChargePrice > 10000)
{
throw new UserFriendlyException("价格不能大于10000");
}
if (appointRegisterAsbitem.Amount < 1)
{
throw new UserFriendlyException("数量不能小于1");
}
}
}
}
}

2
src/Shentun.WebPeis.Domain/Models/AppointPatientRegister.cs

@ -43,7 +43,7 @@ public partial class AppointPatientRegister: AuditedEntity, IHasConcurrencyStamp
public decimal? Weight { get; set; }
public virtual ICollection<Charge> Charges { get; set; } = new List<Charge>();
public virtual ICollection<AppointRegisterAsbitem> AppointRegisterAsbitems { get; set; } = new List<AppointRegisterAsbitem>();
public override object?[] GetKeys()
{
return [AppointPatientRegisterId];

Loading…
Cancel
Save