Compare commits
No commits in common. "2cf4f5d28031b3dee9afdbbaf6ac7e45bf0f953e" and "e2360e2cd5395d686cba277fcb50e88d72434a20" have entirely different histories.
2cf4f5d280
...
e2360e2cd5
|
@ -13,8 +13,6 @@ using System.Linq.Expressions;
|
|||
using IRaCIS.Core.Domain.Interfaces;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using System.Data;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using System.Drawing;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -25,11 +23,9 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IReviewerPayInfoRepository _doctorPayInfoRepository;
|
||||
private readonly ITrialRepository _trialRepository;
|
||||
private readonly IDoctorRepository _doctorRepository;
|
||||
|
||||
private readonly IWorkloadRepository _doctorWorkloadRepository;
|
||||
private readonly IRankPriceRepository _rankPriceRepository;
|
||||
private readonly IUserTrialRepository _userTrialRepository;
|
||||
private readonly IPaymentDetailRepository _paymentDetailRepository;
|
||||
private readonly IPaymentDetailRepository _paymentDetailRepository;
|
||||
private readonly IVolumeRewardService _volumeRewardPriceService;
|
||||
private readonly IExchangeRateRepository _exchangeRateRepository;
|
||||
private readonly IPaymentAdjustmentRepository _payAdjustmentRepository;
|
||||
|
@ -42,8 +38,7 @@ namespace IRaCIS.Application.Services
|
|||
IDoctorRepository doctorRepository,
|
||||
IWorkloadRepository workloadRepository,
|
||||
IRankPriceRepository rankPriceRepository,
|
||||
IUserTrialRepository userTrialRepository,
|
||||
IPaymentDetailRepository paymentDetailRepository,
|
||||
IPaymentDetailRepository paymentDetailRepository,
|
||||
IVolumeRewardService volumeRewardService,
|
||||
IExchangeRateRepository exchangeRateRepository,
|
||||
IEnrollRepository enrollRepository,
|
||||
|
@ -57,8 +52,7 @@ namespace IRaCIS.Application.Services
|
|||
_doctorRepository = doctorRepository;
|
||||
_doctorWorkloadRepository = workloadRepository;
|
||||
_rankPriceRepository = rankPriceRepository;
|
||||
this._userTrialRepository = userTrialRepository;
|
||||
_paymentDetailRepository = paymentDetailRepository;
|
||||
_paymentDetailRepository = paymentDetailRepository;
|
||||
_volumeRewardPriceService = volumeRewardService;
|
||||
_exchangeRateRepository = exchangeRateRepository;
|
||||
_payAdjustmentRepository = paymentAdjustmentRepository;
|
||||
|
@ -742,33 +736,25 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
decimal totalUSD = award + totalNormal;//总费用
|
||||
|
||||
var paymentyearMonth = new DateTime(param.CalculateMonth.Year, param.CalculateMonth.Month, 1).ToString("yyyy-MM");
|
||||
var paymentModel = _paymentRepository.GetAll().FirstOrDefault(t =>
|
||||
t.DoctorId == doctor && t.YearMonth == paymentyearMonth);
|
||||
result = AddOrUpdateMonthlyPayment(new PaymentCommand
|
||||
{
|
||||
DoctorId = doctor,
|
||||
Year = param.CalculateMonth.Year,
|
||||
Month = param.CalculateMonth.Month,
|
||||
PaymentUSD = totalUSD,
|
||||
CalculateUser = token,
|
||||
CalculateTime = DateTime.Now,
|
||||
ExchangeRate = exchangeRate,
|
||||
PaymentCNY = exchangeRate * totalUSD,
|
||||
});
|
||||
|
||||
// 计算金额为0 就不插入
|
||||
if (totalUSD != 0 || paymentModel != null)
|
||||
{
|
||||
result = AddOrUpdateMonthlyPayment(new PaymentCommand
|
||||
{
|
||||
DoctorId = doctor,
|
||||
Year = param.CalculateMonth.Year,
|
||||
Month = param.CalculateMonth.Month,
|
||||
PaymentUSD = totalUSD,
|
||||
CalculateUser = token,
|
||||
CalculateTime = DateTime.Now,
|
||||
ExchangeRate = exchangeRate,
|
||||
PaymentCNY = exchangeRate * totalUSD,
|
||||
});
|
||||
reviewerPaymentUSDList.Add(new ReviewerPaymentUSD { DoctorId = doctor, PaymentUSD = totalUSD, RecordId = result.Data });
|
||||
foreach (var detail in paymentDetailList)
|
||||
{
|
||||
detail.PaymentId = result.Data;
|
||||
}
|
||||
AddOrUpdateMonthlyPaymentDetail(paymentDetailList, result.Data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
reviewerPaymentUSDList.Add(new ReviewerPaymentUSD { DoctorId = doctor, PaymentUSD = totalUSD, RecordId = result.Data });
|
||||
foreach (var detail in paymentDetailList)
|
||||
{
|
||||
detail.PaymentId = result.Data;
|
||||
}
|
||||
AddOrUpdateMonthlyPaymentDetail(paymentDetailList, result.Data);
|
||||
|
||||
UpdatePaymentAdjustment(doctor, yearMonth);
|
||||
}
|
||||
|
@ -929,13 +915,9 @@ namespace IRaCIS.Application.Services
|
|||
IsLock = x.IsLock,
|
||||
DataFrom=x.DataFrom,
|
||||
}).Distinct().ToList();
|
||||
var doctor = _doctorRepository.GetAll().Select(x => x.Id).ToList();
|
||||
|
||||
var doctorIds = _enrollRepository.GetAll().Select(x => x.DoctorId).Distinct().ToList();
|
||||
|
||||
var doctorList = _doctorRepository.GetAll().Where(x=> doctorIds.Contains(x.Id)).Select(x => x.Id).ToList();
|
||||
|
||||
|
||||
doctorList.ForEach(x =>
|
||||
doctor.ForEach(x =>
|
||||
{
|
||||
|
||||
if (!workloadlist.Any(y => y.DoctorId == x))
|
||||
|
|
Loading…
Reference in New Issue