From 7fd2e474cae8671ee8d48fde7091894125e1927c Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 14 Sep 2022 15:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DomainToViewModelMappingProfile.cs | 4 ++-- .../Doctor/DTO/DoctorViewModel.cs | 6 +++--- .../Financial/DTO/CalculateViewModel.cs | 6 +++--- .../Financial/DTO/PaymentDetailViewModel.cs | 6 +++--- .../StatisticsViewModel.cs | 8 ++++---- .../Trial/DTO/DoctorWorkLoadViewModel.cs | 12 +++++------ .../Financial/FinancialService.cs | 20 +++++++++---------- .../Financial/TrialPaymentPriceService.cs | 19 ++++++++++++++++++ IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs | 6 +++--- IRaCIS.Core.Domain/Trial/Enroll.cs | 6 +++--- IRaCIS.Core.Domain/Trial/Trial.cs | 6 +++--- 11 files changed, 59 insertions(+), 40 deletions(-) diff --git a/IRaCIS.Core.Application.Contracts/AutoMapper/DomainToViewModelMappingProfile.cs b/IRaCIS.Core.Application.Contracts/AutoMapper/DomainToViewModelMappingProfile.cs index b912d74..a260d1d 100644 --- a/IRaCIS.Core.Application.Contracts/AutoMapper/DomainToViewModelMappingProfile.cs +++ b/IRaCIS.Core.Application.Contracts/AutoMapper/DomainToViewModelMappingProfile.cs @@ -111,8 +111,8 @@ namespace IRaCIS.Core.Application.Contracts.AutoMapper .ForMember(t => t.ReviewMode, u => u.MapFrom(t => t.Trial.ReviewMode.Value)) .ForMember(t => t.Cro, u => u.MapFrom(t => t.Trial.CRO.CROName)) .ForMember(t => t.Indication, u => u.MapFrom(t => t.Trial.Indication)) - .ForMember(t => t.Expedited, u => u.MapFrom(t => t.Trial.Expedited)) - .ForMember(t => t.DoctorsNames, u => u.MapFrom(t => string.Join(",", t.Trial.EnrollList.Select(x => x.Doctor.ChineseName)))); + .ForMember(t => t.Expedited, u => u.MapFrom(t => t.Trial.Expedited)); + //.ForMember(t => t.DoctorsNames, u => u.MapFrom(t => string.Join(",", t.Trial.EnrollList.Select(x => x.Doctor.ChineseName)))); } } } diff --git a/IRaCIS.Core.Application.Contracts/Doctor/DTO/DoctorViewModel.cs b/IRaCIS.Core.Application.Contracts/Doctor/DTO/DoctorViewModel.cs index 5d379b4..8d166e9 100644 --- a/IRaCIS.Core.Application.Contracts/Doctor/DTO/DoctorViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/Doctor/DTO/DoctorViewModel.cs @@ -197,9 +197,9 @@ namespace IRaCIS.Application.ViewModels public Guid? Id { get; set; } - public int? Training { get; set; } + public decimal? Training { get; set; } - public int? RefresherTraining { get; set; } + public decimal? RefresherTraining { get; set; } public int? Timepoint { get; set; } @@ -216,7 +216,7 @@ namespace IRaCIS.Application.ViewModels public int? Global { get; set; } - public int? Downtime { get; set; } + public decimal? Downtime { get; set; } public string ReviewerCode { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application.Contracts/Financial/DTO/CalculateViewModel.cs b/IRaCIS.Core.Application.Contracts/Financial/DTO/CalculateViewModel.cs index 70c126d..2ff6682 100644 --- a/IRaCIS.Core.Application.Contracts/Financial/DTO/CalculateViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/Financial/DTO/CalculateViewModel.cs @@ -20,9 +20,9 @@ namespace IRaCIS.Application.ViewModels public bool? IsNewTrial { get; set; } - public int? Training { get; set; } + public decimal? Training { get; set; } - public int? RefresherTraining { get; set; } + public decimal? RefresherTraining { get; set; } public int? Timepoint { get; set; } @@ -39,6 +39,6 @@ namespace IRaCIS.Application.ViewModels public int? Global { get; set; } - public int? Downtime { get; set; } + public decimal? Downtime { get; set; } } } diff --git a/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentDetailViewModel.cs b/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentDetailViewModel.cs index 91898ab..3db74b4 100644 --- a/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentDetailViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentDetailViewModel.cs @@ -13,7 +13,7 @@ namespace IRaCIS.Application.ViewModels.Pay public Guid TrialId { get; set; } public string TrialCode { get; set; } public string PaymentType { get; set; } - public int Count { get; set; } + public decimal Count { get; set; } public decimal BasePrice { get; set; } public decimal PersonalAdditional { get; set; } public decimal TrialAdditional { get; set; } @@ -27,7 +27,7 @@ namespace IRaCIS.Application.ViewModels.Pay public bool? IsNewTrial { get; set; } - public decimal? NewPersonalAdditional { get; set; } + //public decimal? NewPersonalAdditional { get; set; } public decimal TotalUnitPrice => BasePrice + PersonalAdditional + TrialAdditional; @@ -167,7 +167,7 @@ namespace IRaCIS.Application.ViewModels.Pay public string TrialCode { get; set; } public Guid TrialId { get; set; } public string Indication { get; set; } - public Guid CroId { get; set; } + public Guid? CroId { get; set; } public string Cro { get; set; } = string.Empty; public int Expedited { get; set; } diff --git a/IRaCIS.Core.Application.Contracts/StatisticsViewModel.cs b/IRaCIS.Core.Application.Contracts/StatisticsViewModel.cs index d907062..9761ab2 100644 --- a/IRaCIS.Core.Application.Contracts/StatisticsViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/StatisticsViewModel.cs @@ -63,7 +63,7 @@ namespace IRaCIS.Application.ViewModels public string TrialCode { get; set; } public Guid TrialId { get; set; } public string Indication { get; set; } - public Guid CroId { get; set; } + public Guid? CroId { get; set; } public string Cro { get; set; } = string.Empty; public string ChineseName { get; set; } = string.Empty; @@ -71,8 +71,8 @@ namespace IRaCIS.Application.ViewModels public string LastName { get; set; } = string.Empty; public string ReviewerCode { get; set; } = string.Empty; - public int Training { get; set; } - public int Downtime { get; set; } + public decimal Training { get; set; } + public decimal Downtime { get; set; } public int Timepoint { get; set; } public int TimepointIn24H { get; set; } public int TimepointIn48H { get; set; } @@ -81,7 +81,7 @@ namespace IRaCIS.Application.ViewModels public int AdjudicationIn48H { get; set; } public int Global { get; set; } - public int RefresherTraining { get; set; } + public decimal RefresherTraining { get; set; } public int PersonalTotal { get; set; } } diff --git a/IRaCIS.Core.Application.Contracts/Trial/DTO/DoctorWorkLoadViewModel.cs b/IRaCIS.Core.Application.Contracts/Trial/DTO/DoctorWorkLoadViewModel.cs index de4a00e..e2c0653 100644 --- a/IRaCIS.Core.Application.Contracts/Trial/DTO/DoctorWorkLoadViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/Trial/DTO/DoctorWorkLoadViewModel.cs @@ -82,9 +82,9 @@ namespace IRaCIS.Application.ViewModels public DateTime WorkTime { get; set; } - public int Training { get; set; } + public decimal Training { get; set; } - public int Downtime { get; set; } + public decimal Downtime { get; set; } public int Timepoint { get; set; } @@ -99,7 +99,7 @@ namespace IRaCIS.Application.ViewModels public int AdjudicationIn48H { get; set; } public int Global { get; set; } - public int RefresherTraining { get; set; } + public decimal RefresherTraining { get; set; } } @@ -195,8 +195,8 @@ namespace IRaCIS.Application.ViewModels public string UpdateTimeStr => UpdateTime?.ToString("yyyy-MM-dd HH:mm:ss"); - public int TrainingTimes { get; set; } - public int Downtime { get; set; } + public decimal TrainingTimes { get; set; } + public decimal Downtime { get; set; } //读片点 public int Timepoint { get; set; } @@ -211,7 +211,7 @@ namespace IRaCIS.Application.ViewModels //全局阅片 public int Global { get; set; } - public int RefresherTraining { get; set; } + public decimal RefresherTraining { get; set; } diff --git a/IRaCIS.Core.Application/Financial/FinancialService.cs b/IRaCIS.Core.Application/Financial/FinancialService.cs index c036d13..213f40c 100644 --- a/IRaCIS.Core.Application/Financial/FinancialService.cs +++ b/IRaCIS.Core.Application/Financial/FinancialService.cs @@ -208,7 +208,7 @@ namespace IRaCIS.Application.Services detailList =(from pay in _paymentDetailRepository.GetAll().Where(t => t.PaymentId == paymentId) - join enroll in _enrollRepository.GetAll() on new { pay.DoctorId, pay.TrialId } equals new { enroll.DoctorId, enroll.TrialId } + //join enroll in _enrollRepository.GetAll() on new { pay.DoctorId, pay.TrialId } equals new { enroll.DoctorId, enroll.TrialId } join price in _TrialPaymentPriceRepository.GetAll() on pay.TrialId equals price.TrialId orderby pay.ShowCodeOrder orderby pay.ShowTypeOrder @@ -227,7 +227,7 @@ namespace IRaCIS.Application.Services DoctorId = pay.DoctorId, ExchangeRate = pay.ExchangeRate, IsNewTrial = price.IsNewTrial, - NewPersonalAdditional = enroll.AdjustmentMultiple, + // NewPersonalAdditional = enroll.AdjustmentMultiple, Count=pay.Count, }).ToList(); @@ -255,7 +255,7 @@ namespace IRaCIS.Application.Services Note = costAdjustment.Note }, IsNewTrial = price.IsNewTrial, - NewPersonalAdditional = enroll.AdjustmentMultiple, + //NewPersonalAdditional = enroll.AdjustmentMultiple, }).ToList(); @@ -264,13 +264,13 @@ namespace IRaCIS.Application.Services detailList.AddRange(adjList); - detailList.ForEach(x => - { - x.PersonalAdditional = x.IsNewTrial == true && x.NewPersonalAdditional != null ? 0 : x.PersonalAdditional; - x.TrialAdditional = x.IsNewTrial == true && x.NewPersonalAdditional != null ? 0 : x.TrialAdditional; - x.BasePrice = x.IsNewTrial == true && x.NewPersonalAdditional != null ? x.NewPersonalAdditional.Value : x.BasePrice; + //detailList.ForEach(x => + //{ + // x.PersonalAdditional = x.IsNewTrial == true && x.NewPersonalAdditional != null ? 0 : x.PersonalAdditional; + // x.TrialAdditional = x.IsNewTrial == true && x.NewPersonalAdditional != null ? 0 : x.TrialAdditional; + // x.BasePrice = x.IsNewTrial == true && x.NewPersonalAdditional != null ? x.NewPersonalAdditional.Value : x.BasePrice; - }); + //}); returnModel.DetailList = detailList.OrderBy(x=>x.ShowCodeOrder).ThenBy(x=>x.ShowTypeOrder).ToList(); @@ -593,7 +593,7 @@ namespace IRaCIS.Application.Services Indication = trial.Indication, TrialCode = trial.Code, Expedited = trial.Expedited, - CroId = trial.CROId, + CroId = trial.CROId , Downtime = workLoad.Downtime * trialCost.Downtime, Training = workLoad.Training * trialCost.Training, diff --git a/IRaCIS.Core.Application/Financial/TrialPaymentPriceService.cs b/IRaCIS.Core.Application/Financial/TrialPaymentPriceService.cs index 51a73ed..b49c6ec 100644 --- a/IRaCIS.Core.Application/Financial/TrialPaymentPriceService.cs +++ b/IRaCIS.Core.Application/Financial/TrialPaymentPriceService.cs @@ -102,7 +102,26 @@ namespace IRaCIS.Application.Services.Pay var data= trialQueryable2.ProjectTo(_mapper.ConfigurationProvider); + // .ForMember(t => t.DoctorsNames, u => u.MapFrom(t => string.Join(",", t.Trial.EnrollList.Select(x => x.Doctor.ChineseName)))); + var trialinfo = this._trialRepository.GetAll().Select(x => new + { + TrialId = x.Id, + Names = x.EnrollList.Select(y => y.Doctor).Select(y => y.ChineseName).ToList() + + }).ToList(); + + + var propName = string.IsNullOrWhiteSpace(queryParam.SortField) ? "SowName" : queryParam.SortField; + data = queryParam.Asc ? data.OrderBy(propName) : data.OrderByDescending(propName); + + + + var list = data.Skip((queryParam.PageIndex - 1) * queryParam.PageSize).Take(queryParam.PageSize).ToList(); + list.ForEach(x => { + x.DoctorsNames = string.Join(",", trialinfo.Where(y => y.TrialId == x.TrialId).Select(y => y.Names).ToList()); + }); + return new PageOutput(queryParam.PageIndex, queryParam.PageSize, data.Count(), list diff --git a/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs b/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs index 46186c5..6785935 100644 --- a/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs +++ b/IRaCIS.Core.Domain/Dcotor/DoctorWorkload.cs @@ -16,9 +16,9 @@ namespace IRaCIS.Core.Domain.Models public DateTime WorkTime { get; set; } - public int Training { get; set; } + public decimal Training { get; set; } - public int Downtime { get; set; } + public decimal Downtime { get; set; } public int Timepoint { get; set; } @@ -33,7 +33,7 @@ namespace IRaCIS.Core.Domain.Models public int AdjudicationIn48H { get; set; } public int Global { get; set; } - public int RefresherTraining { get; set; } + public decimal RefresherTraining { get; set; } public int CreateUserType { get; set; } diff --git a/IRaCIS.Core.Domain/Trial/Enroll.cs b/IRaCIS.Core.Domain/Trial/Enroll.cs index 203d556..2b0efa5 100644 --- a/IRaCIS.Core.Domain/Trial/Enroll.cs +++ b/IRaCIS.Core.Domain/Trial/Enroll.cs @@ -33,9 +33,9 @@ namespace IRaCIS.Core.Domain.Models public DateTime CreateTime { get; set; } #region еļƷѼ۸ñ - public int? Training { get; set; } + public decimal? Training { get; set; } - public int? RefresherTraining { get; set; } + public decimal? RefresherTraining { get; set; } public int? Timepoint { get; set; } @@ -52,7 +52,7 @@ namespace IRaCIS.Core.Domain.Models public int? Global { get; set; } - public int? Downtime { get; set; } + public decimal? Downtime { get; set; } #endregion diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index d14c0a0..435ffd4 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -43,14 +43,14 @@ namespace IRaCIS.Core.Domain.Models public Guid CriterionId { get; set; } = Guid.Empty; - public Guid CROId { get; set; } = Guid.Empty; + public Guid? CROId { get; set; } - public Guid SponsorId { get; set; } = Guid.Empty; + public Guid? SponsorId { get; set; } [StringLength(500)] public string TurnaroundTime { get; set; } = string.Empty; - public Guid ReviewModeId { get; set; } = Guid.Empty; + public Guid? ReviewModeId { get; set; } public int ExpectedPatients { get; set; }