From 6a09a76d6197d73dee25d344e5533fd10dd8c3bc Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 23 Jan 2026 09:52:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Doctor/DoctorListQueryService.cs | 7 ++++- .../Financial/CalculateService.cs | 19 +++++++++----- .../Trial/Workload/TrialWorkloadService.cs | 26 ++++++++++++++----- IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs | 2 +- IRaCIS.Core.Domain/Trial/Enroll.cs | 2 +- Sql脚本/20260121添加字段.sql | 20 +++++++------- 6 files changed, 50 insertions(+), 26 deletions(-) diff --git a/IRaCIS.Core.Application/Doctor/DoctorListQueryService.cs b/IRaCIS.Core.Application/Doctor/DoctorListQueryService.cs index 7c1b50f..8bd8d1e 100644 --- a/IRaCIS.Core.Application/Doctor/DoctorListQueryService.cs +++ b/IRaCIS.Core.Application/Doctor/DoctorListQueryService.cs @@ -31,6 +31,7 @@ namespace IRaCIS.Application.Services private readonly IUserDoctorRepository _userDoctorRepository; private readonly ITrialRepository _trialRepository; private readonly ITrialPaymentPriceRepository _TrialPaymentPrice; + private readonly ITrialRevenuesPriceRepository _trialRevenuesPriceRepository; private readonly IMapper _mapper; public DoctorListQueryService(IDoctorRepository doctorInfoRepository, @@ -41,6 +42,7 @@ namespace IRaCIS.Application.Services IUserDoctorRepository userDoctorRepository, ITrialRepository trialRepository, ITrialPaymentPriceRepository trialPaymentPrice, + ITrialRevenuesPriceRepository trialRevenuesPriceRepository, IMapper mapper ) { @@ -48,6 +50,7 @@ namespace IRaCIS.Application.Services _dictionaryRepository = dictionaryRepository; _hospitalRepository = hospitalRepository; _TrialPaymentPrice = trialPaymentPrice; + _trialRevenuesPriceRepository = trialRevenuesPriceRepository; _enrollRepository = intoGroupRepository; _enrollDetailRepository = intoGroupDetailRepository; @@ -165,6 +168,8 @@ namespace IRaCIS.Application.Services var costStatisticsQueryable = from enroll in _enrollRepository.GetAll().Where(t => t.TrialId == challengeQuery.TrialId) join dociorc in _doctorRepository.GetAll() on enroll.DoctorId equals dociorc.Id join price in _TrialPaymentPrice.GetAll() on enroll.TrialId equals price.TrialId + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on enroll.TrialId equals trialRevenuesPrice.TrialId into temp + from trialRevenuesPrice in temp.DefaultIfEmpty() select new EnrollViewModel() { ChineseName = dociorc.ChineseName, @@ -189,7 +194,7 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = enroll.AdditionalCharge1, AdditionalCharge2 = enroll.AdditionalCharge2, AdditionalCharge3 = enroll.AdditionalCharge3, - Note = enroll.Note, + Note = trialRevenuesPrice.Note, }; diff --git a/IRaCIS.Core.Application/Financial/CalculateService.cs b/IRaCIS.Core.Application/Financial/CalculateService.cs index 87d9f29..0e6bfe6 100644 --- a/IRaCIS.Core.Application/Financial/CalculateService.cs +++ b/IRaCIS.Core.Application/Financial/CalculateService.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using AutoMapper.QueryableExtensions; using IRaCIS.Application.Interfaces; using IRaCIS.Application.ViewModels; @@ -34,6 +34,7 @@ namespace IRaCIS.Application.Services private readonly IExchangeRateRepository _exchangeRateRepository; private readonly IPaymentAdjustmentRepository _payAdjustmentRepository; private readonly IEnrollRepository _enrollRepository; + private readonly ITrialRevenuesPriceRepository _trialRevenuesPriceRepository; private readonly IMapper _mapper; public CalculateService(IPaymentRepository paymentRepository, ITrialPaymentPriceRepository trialPaymentPriceRepository, @@ -41,12 +42,13 @@ namespace IRaCIS.Application.Services ITrialRepository trialRepository, IDoctorRepository doctorRepository, IWorkloadRepository workloadRepository, - IRankPriceRepository rankPriceRepository, - IUserTrialRepository userTrialRepository, - IPaymentDetailRepository paymentDetailRepository, + IRankPriceRepository rankPriceRepository, + IUserTrialRepository userTrialRepository, + IPaymentDetailRepository paymentDetailRepository, IVolumeRewardService volumeRewardService, IExchangeRateRepository exchangeRateRepository, IEnrollRepository enrollRepository, + ITrialRevenuesPriceRepository trialRevenuesPriceRepository, IPaymentAdjustmentRepository paymentAdjustmentRepository, IMapper mapper) { _paymentRepository = paymentRepository; @@ -57,11 +59,12 @@ namespace IRaCIS.Application.Services _doctorRepository = doctorRepository; _doctorWorkloadRepository = workloadRepository; _rankPriceRepository = rankPriceRepository; - this._userTrialRepository = userTrialRepository; - _paymentDetailRepository = paymentDetailRepository; + this._userTrialRepository = userTrialRepository; + _paymentDetailRepository = paymentDetailRepository; _volumeRewardPriceService = volumeRewardService; _exchangeRateRepository = exchangeRateRepository; _payAdjustmentRepository = paymentAdjustmentRepository; + _trialRevenuesPriceRepository = trialRevenuesPriceRepository; _mapper = mapper; } @@ -87,6 +90,8 @@ namespace IRaCIS.Application.Services from trialPay in temp.DefaultIfEmpty() join doctorPayInfo in _doctorPayInfoRepository.GetAll() on doctor.Id equals doctorPayInfo.DoctorId join rankPrice in _rankPriceRepository.GetAll() on doctorPayInfo.RankId equals rankPrice.Id + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on trial.Id equals trialRevenuesPrice.TrialId into trialRevenuesPricetemp + from trialRevenuesPrice in trialRevenuesPricetemp.DefaultIfEmpty() select new CalculatePaymentDTO() { Id = workLoad.Id, @@ -109,7 +114,7 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = workLoad.AdditionalCharge1, AdditionalCharge2 = workLoad.AdditionalCharge2, AdditionalCharge3 = workLoad.AdditionalCharge3, - Note = workLoad.Note, + Note = trialRevenuesPrice.Note, TrialAdditional = trialPay.TrialAdditional, PersonalAdditional = doctorPayInfo.Additional, diff --git a/IRaCIS.Core.Application/Trial/Workload/TrialWorkloadService.cs b/IRaCIS.Core.Application/Trial/Workload/TrialWorkloadService.cs index 135b20a..38cb006 100644 --- a/IRaCIS.Core.Application/Trial/Workload/TrialWorkloadService.cs +++ b/IRaCIS.Core.Application/Trial/Workload/TrialWorkloadService.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using AutoMapper.QueryableExtensions; using IRaCIS.Application.ExpressionExtend; using IRaCIS.Application.Interfaces; @@ -258,6 +258,8 @@ namespace IRaCIS.Application.Services workLoadQueryable = from workLoad in _doctorWorkloadRepository.GetAll().Where(workloadLambda.And(t => t.DataFrom == (int)WorkLoadFromStatus.CRO)) join doctor in _doctorRepository.GetAll() on workLoad.DoctorId equals doctor.Id join trial in _trialRepository.GetAll() on workLoad.TrialId equals trial.Id + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on trial.Id equals trialRevenuesPrice.TrialId into temp + from trialRevenuesPrice in temp.DefaultIfEmpty() select new WorkLoadDetailDTO() { @@ -291,7 +293,7 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = workLoad.AdditionalCharge1, AdditionalCharge2 = workLoad.AdditionalCharge2, AdditionalCharge3 = workLoad.AdditionalCharge3, - Note = workLoad.Note, + Note = trialRevenuesPrice.Note, IsLock = workLoad.IsLock }; tempWorkload.AddRange(workLoadQueryable.ToList()); @@ -303,6 +305,8 @@ namespace IRaCIS.Application.Services workLoadQueryable = from workLoad in _doctorWorkloadRepository.GetAll().Where(workloadLambda.And(t => t.DataFrom == (int)WorkLoadFromStatus.FinalConfirm)) join doctor in _doctorRepository.GetAll() on workLoad.DoctorId equals doctor.Id join trial in _trialRepository.GetAll() on workLoad.TrialId equals trial.Id + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on trial.Id equals trialRevenuesPrice.TrialId into temp + from trialRevenuesPrice in temp.DefaultIfEmpty() select new WorkLoadDetailDTO() { @@ -335,7 +339,7 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = workLoad.AdditionalCharge1, AdditionalCharge2 = workLoad.AdditionalCharge2, AdditionalCharge3 = workLoad.AdditionalCharge3, - Note = workLoad.Note, + Note = trialRevenuesPrice.Note, IsLock = workLoad.IsLock }; tempWorkload.AddRange(workLoadQueryable.ToList()); @@ -364,10 +368,15 @@ namespace IRaCIS.Application.Services AdjudicationIn48H = g.Sum(workLoad => workLoad.AdjudicationIn48H), Training = g.Sum(workLoad => workLoad.Training), - Downtime = g.Sum(workLoad => workLoad.Downtime) + Downtime = g.Sum(workLoad => workLoad.Downtime), + AdditionalCharge1 = g.Sum(workLoad => workLoad.AdditionalCharge1), + AdditionalCharge2 = g.Sum(workLoad => workLoad.AdditionalCharge2), + AdditionalCharge3 = g.Sum(workLoad => workLoad.AdditionalCharge3) }) join doctor in _doctorRepository.GetAll() on workLoad.DoctorId equals doctor.Id join trial in _trialRepository.GetAll() on workLoad.TrialId equals trial.Id + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on trial.Id equals trialRevenuesPrice.TrialId into temp + from trialRevenuesPrice in temp.DefaultIfEmpty() select new WorkLoadDetailDTO() { Id = workLoad.Id, @@ -393,6 +402,10 @@ namespace IRaCIS.Application.Services Training = workLoad.Training, Downtime = workLoad.Downtime, + AdditionalCharge1 = workLoad.AdditionalCharge1, + AdditionalCharge2 = workLoad.AdditionalCharge2, + AdditionalCharge3 = workLoad.AdditionalCharge3, + Note = trialRevenuesPrice.Note, IsLock = workLoad.IsLock }; tempWorkload.AddRange(workLoadQueryable.ToList()); @@ -430,6 +443,8 @@ namespace IRaCIS.Application.Services var workLoadQueryable = from workLoad in _doctorWorkloadRepository.GetAll().Where(workloadLambda) join doctor in _doctorRepository.GetAll() on workLoad.DoctorId equals doctor.Id join trial in _trialRepository.GetAll() on workLoad.TrialId equals trial.Id + join trialRevenuesPrice in _trialRevenuesPriceRepository.GetAll() on trial.Id equals trialRevenuesPrice.TrialId into temp + from trialRevenuesPrice in temp.DefaultIfEmpty() select new WorkLoadDetailViewModel() { @@ -461,7 +476,7 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = workLoad.AdditionalCharge1, AdditionalCharge2 = workLoad.AdditionalCharge2, AdditionalCharge3 = workLoad.AdditionalCharge3, - Note = workLoad.Note, + Note = trialRevenuesPrice.Note, IsLock = workLoad.IsLock }; @@ -674,7 +689,6 @@ namespace IRaCIS.Application.Services AdditionalCharge1 = workLoadAddOrUpdateModel.AdditionalCharge1, AdditionalCharge2 = workLoadAddOrUpdateModel.AdditionalCharge2, AdditionalCharge3 = workLoadAddOrUpdateModel.AdditionalCharge3, - Note = workLoadAddOrUpdateModel.Note, UpdateTime = DateTime.Now, UpdateUserId = userId, diff --git a/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs b/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs index cd5a61a..9933e6c 100644 --- a/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs +++ b/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs @@ -38,7 +38,7 @@ namespace IRaCIS.Core.Domain.Models public decimal AdditionalCharge1 { get; set; } public decimal AdditionalCharge2 { get; set; } public decimal AdditionalCharge3 { get; set; } - public string Note { get; set; } + //public string Note { get; set; } public int CreateUserType { get; set; } diff --git a/IRaCIS.Core.Domain/Trial/Enroll.cs b/IRaCIS.Core.Domain/Trial/Enroll.cs index 761d42f..093eefa 100644 --- a/IRaCIS.Core.Domain/Trial/Enroll.cs +++ b/IRaCIS.Core.Domain/Trial/Enroll.cs @@ -57,7 +57,7 @@ namespace IRaCIS.Core.Domain.Models public decimal? AdditionalCharge1 { get; set; } public decimal? AdditionalCharge2 { get; set; } public decimal? AdditionalCharge3 { get; set; } - public string Note { get; set; } = string.Empty; + //public string Note { get; set; } = string.Empty; #endregion diff --git a/Sql脚本/20260121添加字段.sql b/Sql脚本/20260121添加字段.sql index 6f273b6..79774bc 100644 --- a/Sql脚本/20260121添加字段.sql +++ b/Sql脚本/20260121添加字段.sql @@ -17,11 +17,11 @@ IF not exists(select * from sys.columns where name='AdditionalCharge3' and [obje EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项3', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'Enroll', @level2type = N'COLUMN', @level2name = 'AdditionalCharge3'; END -IF not exists(select * from sys.columns where name='Note' and [object_id]=object_id(N'Enroll')) - BEGIN - alter table Enroll add Note nvarchar(1000) NULL - EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项说明', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'Enroll', @level2type = N'COLUMN', @level2name = 'Note'; - END +--IF not exists(select * from sys.columns where name='Note' and [object_id]=object_id(N'Enroll')) +-- BEGIN +-- alter table Enroll add Note nvarchar(1000) NULL +-- EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项说明', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'Enroll', @level2type = N'COLUMN', @level2name = 'Note'; +-- END -- 2. TrialRevenuesPrice 表 IF not exists(select * from sys.columns where name='AdditionalCharge1' and [object_id]=object_id(N'TrialRevenuesPrice')) @@ -67,11 +67,11 @@ IF not exists(select * from sys.columns where name='AdditionalCharge3' and [obje EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项3', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'DoctorWorkload', @level2type = N'COLUMN', @level2name = 'AdditionalCharge3'; END -IF not exists(select * from sys.columns where name='Note' and [object_id]=object_id(N'DoctorWorkload')) - BEGIN - alter table DoctorWorkload add Note nvarchar(1000) NULL - EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项说明', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'DoctorWorkload', @level2type = N'COLUMN', @level2name = 'Note'; - END +--IF not exists(select * from sys.columns where name='Note' and [object_id]=object_id(N'DoctorWorkload')) +-- BEGIN +-- alter table DoctorWorkload add Note nvarchar(1000) NULL +-- EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'扩展付费项说明', @level0type = N'SCHEMA', @level0name = 'dbo', @level1type = N'TABLE', @level1name = 'DoctorWorkload', @level2type = N'COLUMN', @level2name = 'Note'; +-- END -- 4. TrialRevenuesPriceVerification 表 (类型保持为 bit) IF not exists(select * from sys.columns where name='AdditionalCharge1' and [object_id]=object_id(N'TrialRevenuesPriceVerification'))