72 lines
2.4 KiB
C#
72 lines
2.4 KiB
C#
using IRaCIS.Api.Filter;
|
|
using IRaCIS.Application.Interfaces;
|
|
using IRaCIS.Application.ViewModels;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
|
|
|
|
|
namespace IRaCIS.Api.Controllers.Pay
|
|
{
|
|
/// <summary>
|
|
/// Financial 支撑信息---工作量奖励标准
|
|
/// </summary>
|
|
[Route("volumeReward")]
|
|
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Financial")]
|
|
public class VolumeRewardController : ControllerBase
|
|
{
|
|
private readonly IVolumeRewardService _volumeRewardService;
|
|
private readonly ICalculateService _calculateService;
|
|
|
|
public VolumeRewardController(IVolumeRewardService volumeRewardService,
|
|
ICalculateService calculateService)
|
|
{
|
|
_volumeRewardService = volumeRewardService;
|
|
_calculateService = calculateService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 批量更新奖励费用[AUTH]
|
|
/// </summary>
|
|
|
|
[LogFilter]
|
|
[HttpPost, Route("addOrUpdatevolumeRewardPriceList")]
|
|
public IResponseOutput AddOrUpdateAwardPriceList(IEnumerable<AwardPriceCommand> addOrUpdateModel)
|
|
{
|
|
var userId = User.FindFirst("id").Value;
|
|
var result = _volumeRewardService.AddOrUpdateVolumeRewardPriceList(addOrUpdateModel, Guid.Parse(userId));
|
|
|
|
var calcList = _calculateService.GetNeedCalculateReviewerList(Guid.Empty, string.Empty);
|
|
foreach (var item in calcList)
|
|
{
|
|
if (item != null)
|
|
{
|
|
_calculateService.CalculateMonthlyPayment(new CalculateDoctorAndMonthDTO()
|
|
{
|
|
NeedCalculateReviewers = new List<Guid>()
|
|
{
|
|
item.DoctorId
|
|
},
|
|
CalculateMonth = DateTime.Parse(item.YearMonth)
|
|
}, User.FindFirst("id").Value);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页获取奖励单价列表
|
|
/// </summary>
|
|
|
|
[HttpPost, Route("getVolumeRewardPriceList")]
|
|
public IResponseOutput<PageOutput<AwardPriceDTO>> GetAwardPriceList(AwardPriceQueryDTO queryParam)
|
|
{
|
|
return ResponseOutput.Ok(_volumeRewardService.GetVolumeRewardPriceList(queryParam));
|
|
|
|
}
|
|
|
|
}
|
|
}
|