master
parent
aaaaace8b6
commit
5e50ad1d7e
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,6 +6,14 @@ 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; }
|
||||
|
@ -35,6 +43,15 @@ namespace IRaCIS.Application.ViewModels
|
|||
|
||||
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; }
|
||||
|
@ -63,6 +80,31 @@ namespace IRaCIS.Application.ViewModels
|
|||
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.PaymentUSD);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal SumPaymentCNY {
|
||||
get
|
||||
{
|
||||
return this.Row.Sum(x => x.PaymentCNY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MonthlyPaymentQueryDTO : PageInput
|
||||
{
|
||||
public DateTime StatisticsDate { get; set; }
|
||||
|
|
|
@ -26,9 +26,11 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IReviewerPayInfoRepository _doctorPayInfoRepository;
|
||||
private readonly ITrialRepository _trialRepository;
|
||||
private readonly IDoctorRepository _doctorRepository;
|
||||
private readonly IExchangeRateService _exchangeRateService;
|
||||
private readonly IRankPriceRepository _rankPriceRepository;
|
||||
private readonly IPaymentDetailRepository _paymentDetailRepository;
|
||||
private readonly ICRORepository _croRepository;
|
||||
|
||||
private readonly IWorkloadRepository _workloadRepository;
|
||||
private readonly ITrialRevenuesPriceRepository _trialRevenuePriceRepository;
|
||||
private readonly IPaymentAdjustmentRepository _payAdjustmentRepository;
|
||||
|
@ -42,6 +44,7 @@ namespace IRaCIS.Application.Services
|
|||
IReviewerPayInfoRepository doctorPayInfoRepository,
|
||||
ITrialRepository trialRepository,
|
||||
IDoctorRepository doctorRepository,
|
||||
IExchangeRateService exchangeRateService,
|
||||
IRankPriceRepository rankPriceRepository,
|
||||
IPaymentDetailRepository costStatisticsDetailRepository,
|
||||
ICRORepository croCompanyRepository,
|
||||
|
@ -58,6 +61,7 @@ namespace IRaCIS.Application.Services
|
|||
_doctorPayInfoRepository = doctorPayInfoRepository;
|
||||
_trialRepository = trialRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
this._exchangeRateService = exchangeRateService;
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
_paymentDetailRepository = costStatisticsDetailRepository;
|
||||
_croRepository = croCompanyRepository;
|
||||
|
@ -1224,6 +1228,12 @@ namespace IRaCIS.Application.Services
|
|||
System.IO.Directory.CreateDirectory("./file/Direct");
|
||||
}
|
||||
|
||||
|
||||
if (!System.IO.Directory.Exists("./file/Summary"))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory("./file/Summary");
|
||||
}
|
||||
|
||||
if (!System.IO.Directory.Exists("./Zip"))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory("./Zip");
|
||||
|
@ -1244,7 +1254,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
var deletepaths =new List<string>(){
|
||||
"./file/Direct","./file/云账户" ,"./file"
|
||||
"./file/Direct","./file/云账户" ,"./file/Summary","./file"
|
||||
|
||||
|
||||
};
|
||||
|
@ -1335,6 +1345,30 @@ namespace IRaCIS.Application.Services
|
|||
var cloudPaymentPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payroll Summary_(云账户).xlsx");
|
||||
MiniExcel.SaveAsByTemplate($"./file/云账户/Payroll Summary_{inDto.YearMonth}(云账户).xlsx", cloudPaymentPath, cloudPaymentInfo);
|
||||
|
||||
|
||||
|
||||
// 生成summary
|
||||
|
||||
var summaryPaymentPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payment Summary.xlsx");
|
||||
|
||||
|
||||
var sumData = GetMonthlyPaymentList(new MonthlyPaymentQueryDTO()
|
||||
{
|
||||
PageIndex = 1,
|
||||
PageSize = 99999,
|
||||
Asc = true,
|
||||
StatisticsDate = DateTime.Parse(inDto.YearMonth),
|
||||
}).CurrentPageData.ToList();
|
||||
|
||||
SummaryPaymentData summaryPaymentData = new SummaryPaymentData()
|
||||
{
|
||||
YearMonth=inDto.YearMonth,
|
||||
Row= sumData,
|
||||
ExchangeRate = _exchangeRateService.GetExchangeRateByMonth(inDto.YearMonth)
|
||||
};
|
||||
|
||||
MiniExcel.SaveAsByTemplate($"./file/Summary/Payroll Summary_{inDto.YearMonth}.xlsx", summaryPaymentPath, summaryPaymentData);
|
||||
|
||||
ZipFile.CreateFromDirectory("./file", "Zip/Payroll.zip");
|
||||
|
||||
Stream stream = new System.IO.FileStream("./Zip/Payroll.zip", FileMode.Open, FileAccess.Read);
|
||||
|
|
Loading…
Reference in New Issue