Commit 042ce8fe by 799284587@qq.com

抽取初稿

parent b30e08ee
......@@ -25,7 +25,7 @@ public class TemplateController : Controller
private readonly TemplateService templateService;
private readonly ExtractService extractService;
private HospitalService hospitalService;
private IHostingEnvironment evn;
private IHostingEnvironment env;
private ClaimService claim;
private Application application;
private WebapiUrl url;
......@@ -35,7 +35,7 @@ public class TemplateController : Controller
public TemplateController(TemplateService templateService,
HospitalService hospitalService,
ExtractService extractService,
IHostingEnvironment evn,
IHostingEnvironment env,
ClaimService claim,
IOptions<Application> options,
IOptions<WebapiUrl> url,
......@@ -45,7 +45,7 @@ public class TemplateController : Controller
this.templateService = templateService;
this.extractService = extractService;
this.hospitalService = hospitalService;
this.evn = evn;
this.env = env;
this.claim = claim;
this.application = options.Value;
this.url = url.Value;
......@@ -54,6 +54,29 @@ public class TemplateController : Controller
}
/// <summary>
/// 从WebAPI下载模板
/// </summary>
/// <returns></returns>
[Route("downtemplate")]
[NoVerify]
public IActionResult DownFile([FromQuery]DownRequest request)
{
string path = (request.TempType == 1)
? Path.Combine(env.ContentRootPath, "Template", "医院绩效模板.xlsx")
: Path.Combine(env.ContentRootPath, "Template", "医院二次分配绩效模板.xlsx");
var memoryStream = new MemoryStream();
using (var stream = new FileStream(path, FileMode.Open))
{
stream.CopyToAsync(memoryStream).Wait();
}
memoryStream.Seek(0, SeekOrigin.Begin);
var provider = new FileExtensionContentTypeProvider();
var memi = provider.Mappings["xlsx"];
return File(memoryStream, memi, Path.GetFileName(path));
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="form"></param>
......@@ -77,7 +100,7 @@ public ApiResponse Import([FromForm] IFormCollection form)
var name = FileHelper.GetFileNameNoExtension(file.FileName) + DateTime.Now.ToString("yyyyMMddHHmmssfff");
var ext = FileHelper.GetExtension(file.FileName);
var dpath = Path.Combine(evn.ContentRootPath, "Files", $"{hospitalid}", "first");
var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalid}", "first");
FileHelper.CreateDirectory(dpath);
var path = Path.Combine(dpath, $"{name}{ext}");
......@@ -209,7 +232,7 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
if (file == null)
return new ApiResponse(ResponseType.Error, "上传文件无效");
var dpath = Path.Combine(evn.ContentRootPath, "Files", $"{hospitalId}", "autoextract");
var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalId}", "autoextract");
FileHelper.CreateDirectory(dpath);
var path = Path.Combine(dpath, FileHelper.GetFileName(file.FileName));
......
......@@ -47,6 +47,15 @@
</Content>
</ItemGroup>
<ItemGroup>
<None Update="Template\医院二次分配绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Template\医院绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
</Project>
......@@ -23,6 +23,28 @@ public enum States
Disabled = 2,
}
/// <summary> 提取数据使用模板 </summary>
public enum UseTemplate
{
/// <summary> 上次绩效 </summary>
[Description("上次绩效")]
LastAllot = 1,
/// <summary> 配置模板 </summary>
[Description("配置模板")]
Config = 2,
}
/// <summary> 提取数据使用模板 </summary>
public enum DbSrouceType
{
/// <summary> 标准库 </summary>
[Description("标准库")]
Standard = 1,
/// <summary> 绩效库 </summary>
[Description("绩效库")]
Performance = 2,
}
public enum AllotStates
{
/// <summary> 用户状态 </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ExtractDto
{
public string Department { get; set; }
public string Category { get; set; }
public decimal Value { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DownRequest : ApiRequest
{
public int TempType { get; set; }
}
}
......@@ -42,6 +42,11 @@ public class mod_item
public Nullable<decimal> FactorValue2 { get; set; }
/// <summary>
/// 医技系数
/// </summary>
public Nullable<decimal> FactorValue3 { get; set; }
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public Nullable<int> ExtractId { get; set; }
......
......@@ -25,6 +25,19 @@
<ProjectReference Include="..\Performance.Services\Performance.Services.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Template\" />
</ItemGroup>
<ItemGroup>
<None Include="..\Performance.Api\Template\医院二次分配绩效模板.xlsx" Link="Template\医院二次分配绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Performance.Api\Template\医院绩效模板.xlsx" Link="Template\医院绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
</Project>
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