CostCalculationItem/IRaCIS.Core.Application.Con.../Financial/DTO/PaymentViewModel.cs

365 lines
9.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
using IRaCIS.Core.Domain.Models;
namespace IRaCIS.Application.ViewModels
{
public enum PendingEnum
{
Pending=0,
Lock=1,
}
public class PaymentDTO
{
public PageOutput<PaymentViewModel> CostList { get; set; }
public decimal ExchangeRate { get; set; }
}
public class PaymentViewModel
{
public Guid Id { get; set; }
public string RankName { get; set; }
public Guid DoctorId { get; set; }
public string YearMonth { get; set; }
public DateTime YearMonthDate { get; set; }
public DateTime? CalculateTime { get; set; }
public string CalculateUser { get; set; }
//额外信息
public string Code { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string ChineseName { get; set; }
public string Phone { get; set; }
public string DoctorNameInBank { get; set; }
public string IDCard { get; set; }
public string BankCardNumber { get; set; }
public string BankName { get; set; }
public bool IsLock { get; set; } = false;
public string IsLockStr
{
get
{
return this.IsLock ? PendingEnum.Lock.ToString() : PendingEnum.Pending.ToString();
}
}
public decimal ExchangeRate { get; set; }
public decimal PaymentCNY { get; set; }
public decimal AdjustPaymentCNY { get; set; }
public decimal TotalPaymentCNY { get; set; }
public decimal PaymentUSD { get; set; }
public decimal AdjustPaymentUSD { get; set; }
public decimal TotalPaymentUSD { get; set; }
public PaymentMethod PaymentMethod { get; set; }
public string Paymethod
{
get
{
return PaymentMethod == PaymentMethod.CloudPayment ? "云账户" : "Direct";
}
}
}
public class PaymentCommand
{
public Guid Id { get; set; }
public Guid DoctorId { get; set; }
public string YearMonth => new DateTime(Year, Month, 1).ToString("yyyy-MM");
public int Year { get; set; }
public int Month { get; set; }
public decimal PaymentUSD { get; set; }
public DateTime CalculateTime { get; set; }
public decimal PaymentCNY { get; set; }
public decimal ExchangeRate { get; set; }
public string CalculateUser { get; set; }
}
public class SummaryPaymentData
{
public List<PaymentViewModel> Row { get; set; }
public string YearMonth { get; set; }
public decimal ExchangeRate { get; set; }
public decimal SumPaymentUSD
{
get
{
return this.Row.Sum(x => x.TotalPaymentUSD);
}
}
public decimal SumPaymentCNY {
get
{
return this.Row.Sum(x => x.TotalPaymentCNY);
}
}
}
public class MonthlyPaymentQueryDTO : PageInput
{
public DateTime StatisticsDate { get; set; }
public string KeyWord { get; set; }
public int? Nation { get; set; }
}
public class MonthlyPaymentDetailQuery
{
public Guid PaymentId { get; set; }
public Guid ReviewerId { get; set; }
public DateTime YearMonth { get; set; }
}
//public class LaborPaymentQuery
//{
// public Guid PaymentId { get; set; }
// public Guid ReviewerId { get; set; }
// public DateTime YearMonth { get; set; }
//}
public class RemunerationInfo
{
public string YearMonth { get; set; }
public List<Remuneration> Rows { get; set; }
public decimal SumPaymentCNY
{
get
{
return Rows.Sum(x => x.PaymentCNY);
}
}
public decimal SumTaxCNY
{
get
{
return Rows.Sum(x => x.TaxCNY);
}
}
public decimal SumActuallyPaidCNY
{
get
{
return Rows.Sum(x => x.ActuallyPaidCNY);
}
}
}
public class ExportLaborPaymentInDto
{
public List<Guid> PaymentIds { get; set; }
public string YearMonth { get; set; }
}
public class ChangePaymentMethodInDto
{
public Guid Id { get; set; }
public PaymentMethod PaymentMethod { get; set; }
}
public class CloudPaymentInfo
{
public string YearMonth { get; set; }
public List<CloudPayment> Rows { get; set; }
public decimal SumActuallyPaidCNY
{
get
{
return Rows.Sum(x => x.ActuallyPaidCNY);
}
}
public decimal SumPlatformFee
{
get
{
return Rows.Sum(x => x.PlatformFee);
}
}
public decimal SumPlatformFeeSum
{
get
{
return Rows.Sum(x => x.PlatformFeeSum);
}
}
public decimal SumPaymentCNY
{
get
{
return Rows.Sum(x => x.PaymentCNY);
}
}
public decimal SumTaxCNY
{
get
{
return Rows.Sum(x => x.TaxCNY);
}
}
}
public class Remuneration
{
public string ChineseName { get; set; }
public string ResidentId { get; set; }
public string Phone { get; set; }
public string AccountNumber { get; set; }
public string Bank { get; set; }
public decimal PaymentCNY { get; set; }
public decimal TaxCNY { get; set; }
public decimal ActuallyPaidCNY { get; set; }
public decimal BankTransferCNY { get; set; }
public string YearMonth { get; set; }
public string NextYearMonth { get; set; }
}
public class CloudPayment : Remuneration
{
/// <summary>
/// 平台费
/// </summary>
public decimal PlatformFee { get; set; }
/// <summary>
/// 平台总额
/// </summary>
public decimal PlatformFeeSum { get {
return PlatformFee + ActuallyPaidCNY;
} }
}
public class TrialAnalysisDTO
{
public Guid TrialId { get; set; }
public string Indication { get; set; }
public string TrialCode { get; set; }
public string Cro { get; set; } = string.Empty;
public int Expedited { get; set; }
public string Type { get; set; }
public decimal PaymentUSD { get; set; }
public decimal RevenusUSD { get; set; }
public decimal GrossProfit => RevenusUSD - PaymentUSD;
public decimal GrossProfitMargin
{
get {
if (RevenusUSD == 0)
return 0;
else
{
return GrossProfit / RevenusUSD;
}
}
}
}
public class LaborPayment
{
public string ChineseName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string ResidentId { get; set; }
public string Phone { get; set; }
public string AccountNumber { get; set; }
public string Bank { get; set; }
public string YearMonth { get; set; }
public decimal PaymentCNY { get; set; }
public decimal TaxCNY { get; set; }
public decimal ActuallyPaidCNY { get; set; }
public decimal BankTransferCNY { get; set; }
public PaymentMethod PaymentMethod { get; set; }
}
public class ReviewerAnalysisDTO
{
public List<string> MissingTrialCodes = new List<string>();
public string ChineseName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Guid ReviewerId { get; set; }
public string ReviewerCode { get; set; }
public decimal PaymentUSD { get; set; }
public decimal RevenusUSD { get; set; }
public decimal GrossProfit => RevenusUSD - PaymentUSD;
public decimal GrossProfitMargin
{
get {
if (RevenusUSD == 0)
return 0;
else
{
return GrossProfit / RevenusUSD;
}
}
}
}
public class AnalysisQueryDTO
{
public string Reviewer { get; set; }
public DateTime BeginDate { get; set; }
public DateTime EndDate { get; set; }
public int? Nation { get; set; }
}
public class TrialAnalysisQueryDTO
{
public Guid? CroId { get; set; }
public string TrialCode { get; set; }
public DateTime BeginDate { get; set; }
public DateTime EndDate { get; set; }
public int? AttendedReviewerType { get; set; }
}
}