下载模板文件

parent e944b8f7
...@@ -58,7 +58,7 @@ public class TemplateController : Controller ...@@ -58,7 +58,7 @@ public class TemplateController : Controller
} }
/// <summary> /// <summary>
/// 从WebAPI下载模板 /// 从WebAPI下载模板 1、医院绩效模板 2、医院二次分配绩效模板 3、医院绩效模板(无执行科室)
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("downtemplate")] [Route("downtemplate")]
...@@ -66,9 +66,19 @@ public class TemplateController : Controller ...@@ -66,9 +66,19 @@ public class TemplateController : Controller
[AllowAnonymous] [AllowAnonymous]
public IActionResult DownFile(int type = 1) public IActionResult DownFile(int type = 1)
{ {
string path = (type == 1) string path = "";
? Path.Combine(env.ContentRootPath, "Template", "医院绩效模板.xlsx") switch (type)
: Path.Combine(env.ContentRootPath, "Template", "医院二次分配绩效模板.xlsx"); {
case 1:
path = Path.Combine(env.ContentRootPath, "Template", "医院绩效模板.xlsx");
break;
case 2:
path = Path.Combine(env.ContentRootPath, "Template", "医院二次分配绩效模板.xlsx");
break;
case 3:
path = Path.Combine(env.ContentRootPath, "Template", "医院绩效模板(无执行科室).xlsx");
break;
}
var memoryStream = new MemoryStream(); var memoryStream = new MemoryStream();
using (var stream = new FileStream(path, FileMode.Open)) using (var stream = new FileStream(path, FileMode.Open))
...@@ -343,7 +353,7 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho ...@@ -343,7 +353,7 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
{ {
logger.LogInformation($"保存提取文件异常{ex.ToString()}"); logger.LogInformation($"保存提取文件异常{ex.ToString()}");
LogHelper.Error($"保存失败:" + ex.ToString(), "保存提取文件"); LogHelper.Error($"保存失败:" + ex.ToString(), "保存提取文件");
return new ApiResponse(ResponseType.Error,ex.Message); return new ApiResponse(ResponseType.Error, ex.Message);
} }
} }
} }
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Template\~%24医院绩效模板.xlsx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="8.0.0" /> <PackageReference Include="AutoMapper" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" />
<PackageReference Include="CSRedisCore" Version="3.0.45" /> <PackageReference Include="CSRedisCore" Version="3.0.45" />
......
...@@ -690,7 +690,7 @@ ...@@ -690,7 +690,7 @@
</member> </member>
<member name="M:Performance.Api.Controllers.TemplateController.DownFile(System.Int32)"> <member name="M:Performance.Api.Controllers.TemplateController.DownFile(System.Int32)">
<summary> <summary>
从WebAPI下载模板 从WebAPI下载模板 1、医院绩效模板 2、医院二次分配绩效模板 3、医院绩效模板(无执行科室)
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
......
...@@ -98,7 +98,7 @@ private PerExcel Import(per_allot allot) ...@@ -98,7 +98,7 @@ private PerExcel Import(per_allot allot)
} }
else else
{ {
if (sheet.SheetName.Contains("开单医院")) if (sheet.SheetName.Contains("无执行科室"))
isnew = true; isnew = true;
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace Performance.Services namespace Performance.Services
{ {
/// <summary> /// <summary>
/// 开单医院收入 /// 无执行科室医院收入
/// </summary> /// </summary>
public class PerSheetDataReadBillIncome : IPerSheetDataRead public class PerSheetDataReadBillIncome : IPerSheetDataRead
{ {
......
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