80 lines
2.9 KiB
C#
80 lines
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using IRaCIS.Application.Interfaces;
|
|
using IRaCIS.Application.ViewModels;
|
|
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace IRaCIS.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// Financial 支撑信息---医生付费信息及支付标准配置
|
|
/// </summary>
|
|
[Route("reviewerPayInfomation")]
|
|
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Financial")]
|
|
public class ReviewerPayInfomationController : ControllerBase
|
|
{
|
|
private IReviewerPayInfoService _doctorPayInfoService;
|
|
private readonly ICalculateService _calculateService;
|
|
|
|
public ReviewerPayInfomationController(IReviewerPayInfoService doctorPayInfoService,
|
|
ICalculateService calculateService)
|
|
{
|
|
_doctorPayInfoService = doctorPayInfoService;
|
|
_calculateService = calculateService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加或更新(替换)医生支付展信息[AUTH]
|
|
/// </summary>
|
|
|
|
[HttpPost, Route("addOrUpdateReviewerPayInfo")]
|
|
public IResponseOutput AddOrUpdateReviewerPayInfo(ReviewerPayInfoCommand addOrUpdateModel)
|
|
{
|
|
var userId = Guid.Parse(User.FindFirst("id").Value);
|
|
var result = _doctorPayInfoService.AddOrUpdateReviewerPayInfo(addOrUpdateModel, userId);
|
|
var calcList = _calculateService.GetNeedCalculateReviewerList(addOrUpdateModel.DoctorId, 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("getReviewerPayInfoList")]
|
|
public IResponseOutput<PageOutput<DoctorPayInfoQueryListDTO>> GetReviewerPayInfoList(DoctorPaymentInfoQueryDTO queryParam)
|
|
{
|
|
return ResponseOutput.Ok(_doctorPayInfoService.GetDoctorPayInfoList(queryParam)) ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据医生Id获取支付信息
|
|
/// </summary>
|
|
/// <param name="doctorId">医生Id</param>
|
|
/// <returns></returns>
|
|
|
|
[HttpGet, Route("getReviewerPayInfo/{doctorId:guid}")]
|
|
public IResponseOutput<DoctorPayInfoQueryListDTO> GetReviewerPayInfo(Guid doctorId)
|
|
{
|
|
return ResponseOutput.Ok(_doctorPayInfoService.GetReviewerPayInfo(doctorId)) ;
|
|
}
|
|
}
|
|
}
|