Commit 18968fad by 799284587@qq.com

提取

parent b0823f19
......@@ -131,6 +131,7 @@ public ApiResponse Import([FromForm] IFormCollection form)
return new ApiResponse(ResponseType.OK);
}
#region 老版提取
/// <summary>
/// 提取绩效数据
/// </summary>
......@@ -191,6 +192,7 @@ public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBo
throw ex;
}
}
#endregion
/// <summary>
/// 从WebAPI下载文件
......
......@@ -1223,6 +1223,21 @@
发放系数
</summary>
</member>
<member name="P:Performance.DtoModels.ExtractRequest.AllotId">
<summary>
绩效ID
</summary>
</member>
<member name="P:Performance.DtoModels.ExtractRequest.HospitalId">
<summary>
医院ID
</summary>
</member>
<member name="P:Performance.DtoModels.ExtractRequest.UseScheme">
<summary>
使用方案
</summary>
</member>
<member name="T:Performance.DtoModels.HospitalRequest">
<summary>
登录请求
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ExtractRequest
{
/// <summary>
/// 绩效ID
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public int HospitalId { get; set; }
/// <summary>
/// 使用方案
/// </summary>
public int UseScheme { get; set; }
}
public class ExtractRequestValidator : AbstractValidator<ExtractRequest>
{
public ExtractRequestValidator()
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.UseScheme).NotNull().InclusiveBetween(1, 2);
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using FluentValidation.AspNetCore;
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
......@@ -15,6 +10,11 @@
using Performance.DtoModels.AppSettings;
using Performance.Infrastructure;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Extract.Api.Controllers
{
......@@ -22,15 +22,20 @@ namespace Performance.Extract.Api.Controllers
public class ExtractController : Controller
{
private readonly ExtractService extractService;
private readonly NewExtractService newExtractService;
private readonly HospitalService hospitalService;
private readonly WebapiUrl url;
private readonly ILogger<ExtractController> logger;
private IHostingEnvironment evn;
public ExtractController(ExtractService extractService, HospitalService hospitalService,
IOptions<WebapiUrl> url, ILogger<ExtractController> logger,
private readonly IHostingEnvironment evn;
public ExtractController(ExtractService extractService,
NewExtractService newExtractService,
HospitalService hospitalService,
IOptions<WebapiUrl> url,
ILogger<ExtractController> logger,
IHostingEnvironment evn)
{
this.extractService = extractService;
this.newExtractService = newExtractService;
this.hospitalService = hospitalService;
this.url = url.Value;
this.logger = logger;
......@@ -100,5 +105,21 @@ public void Index([FromBody]AllotRequest request)
}
logger.LogInformation(token + ",提取结束,请求参数:" + JsonHelper.Serialize(request));
}
#region 新版提取
/// <summary>
/// 提取绩效数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("extract")]
[HttpPost]
public void ExtractData([CustomizeValidator, FromBody]ExtractRequest request)
{
newExtractService.ExtractData(request.AllotId, "", request.HospitalId, (UseTemplate)request.UseScheme);
}
#endregion
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@ public class PerSheetDataReadIncome : IPerSheetDataRead
{
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 4,
HeaderFirstRowNum = 1,
HeaderLastRowNum = 4,
HeaderFirstCellNum = 0,
DataFirstRowNum = 5,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment