diff --git a/src/Shentun.WebPeis.Application.Contracts/AppointPatientRegisters/CreateAppointPatientRegisterDto.cs b/src/Shentun.WebPeis.Application.Contracts/AppointPatientRegisters/CreateAppointPatientRegisterDto.cs index a39f794..d067d57 100644 --- a/src/Shentun.WebPeis.Application.Contracts/AppointPatientRegisters/CreateAppointPatientRegisterDto.cs +++ b/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 AppointRegisterAsbitems { get; set; } = new List(); } } diff --git a/src/Shentun.WebPeis.Application.Contracts/AppointRegisterAsbitems/CreateAppointRegisterAsbitemDto.cs b/src/Shentun.WebPeis.Application.Contracts/AppointRegisterAsbitems/CreateAppointRegisterAsbitemDto.cs new file mode 100644 index 0000000..e6d2187 --- /dev/null +++ b/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; } + + + + } +} diff --git a/src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs b/src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs index 7353825..8047c0d 100644 --- a/src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs +++ b/src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs @@ -20,26 +20,26 @@ namespace Shentun.WebPeis.AppointPatientRegisters { private readonly IRepository _repository; private readonly IRepository _itemTypeRepository; - private readonly IRepository _diseaseScreeningTypeRepository; private readonly CacheService _cacheService; - + private readonly AppointPatientRegisterManager _appointPatientRegisterManager; public AppointPatientRegisterAppService(IRepository repository, CacheService cacheService, IRepository itemTypeRepository, - IRepository 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(input); + entity = await _appointPatientRegisterManager.CreateAsync(entity); } } } diff --git a/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs b/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs index 9eb6d86..90b993a 100644 --- a/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs +++ b/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs @@ -56,8 +56,8 @@ public class WebPeisApplicationAutoMapperProfile : Profile CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/src/Shentun.WebPeis.Domain.Shared/Enums/PayModeFlag.cs b/src/Shentun.WebPeis.Domain.Shared/Enums/PayModeFlag.cs new file mode 100644 index 0000000..c8ed299 --- /dev/null +++ b/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"; + } +} diff --git a/src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs b/src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs index a1e0165..36935e4 100644 --- a/src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs +++ b/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"); + } + } } } } diff --git a/src/Shentun.WebPeis.Domain/Models/AppointPatientRegister.cs b/src/Shentun.WebPeis.Domain/Models/AppointPatientRegister.cs index 6411852..3dd9862 100644 --- a/src/Shentun.WebPeis.Domain/Models/AppointPatientRegister.cs +++ b/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 Charges { get; set; } = new List(); - + public virtual ICollection AppointRegisterAsbitems { get; set; } = new List(); public override object?[] GetKeys() { return [AppointPatientRegisterId];