bug版

parent 7880990d
...@@ -113,11 +113,11 @@ public void ConfigureServices(IServiceCollection services) ...@@ -113,11 +113,11 @@ public void ConfigureServices(IServiceCollection services)
var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString); var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
RedisHelper.Initialization(csredis); RedisHelper.Initialization(csredis);
//后台任务调度 ////后台任务调度
services.AddHangfire(config => //services.AddHangfire(config =>
{ //{
config.UseRedisStorage(connection.Value.HangfireRedisConnectionString); // config.UseRedisStorage(connection.Value.HangfireRedisConnectionString);
}); //});
services.AddDbContext<PerformanceDbContext>(options => services.AddDbContext<PerformanceDbContext>(options =>
{ {
...@@ -148,8 +148,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF ...@@ -148,8 +148,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
// c.RoutePrefix = string.Empty; // c.RoutePrefix = string.Empty;
//}); //});
app.UseHangfireServer(); //app.UseHangfireServer();
app.UseHangfireDashboard(); //app.UseHangfireDashboard();
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName); loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
app.UseMvc(); app.UseMvc();
......
using NPOI.SS.UserModel;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.Services
{
public class NopiSevice
{
public static decimal? GetCellValue(ICell cell)
{
if (cell != null)
{
switch (cell.CellType)
{
case CellType.Numeric:
return ConvertHelper.To<decimal?>(cell.NumericCellValue);
case CellType.String:
return ConvertHelper.To<decimal?>(cell.StringCellValue);
case CellType.Formula:
return ConvertHelper.To<decimal?>(cell.NumericCellValue);
}
}
return null;
}
}
}
...@@ -50,8 +50,8 @@ public SheetType GetSheetType(string sheetName) ...@@ -50,8 +50,8 @@ public SheetType GetSheetType(string sheetName)
//else //else
if (sheetName.StartsWith("1.0")) if (sheetName.StartsWith("1.0"))
return SheetType.OtherIncome; return SheetType.OtherIncome;
//else if (sheetName.StartsWith("1.1")) else if (sheetName.StartsWith("1.1"))
//return SheetType.Income; return SheetType.Income;
else if (sheetName.StartsWith("2.")) else if (sheetName.StartsWith("2."))
return SheetType.Expend; return SheetType.Expend;
else if (sheetName.StartsWith("3.")) else if (sheetName.StartsWith("3."))
......
...@@ -87,7 +87,7 @@ public PerSheet MergeCompute(PerExcel excel) ...@@ -87,7 +87,7 @@ public PerSheet MergeCompute(PerExcel excel)
private string GetCleanSheetName(string sheetName) private string GetCleanSheetName(string sheetName)
{ {
sheetName = sheetName sheetName = sheetName.Trim()
.Replace("医生组", "") .Replace("医生组", "")
.Replace("护理组", "") .Replace("护理组", "")
.Replace(".", ""); .Replace(".", "");
......
...@@ -65,7 +65,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -65,7 +65,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
continue; continue;
if (!string.IsNullOrEmpty(athead?.CellValue) && athead.CellValue.Contains("备注")) if (!string.IsNullOrEmpty(athead?.CellValue) && athead.CellValue.Contains("备注"))
continue; continue;
var cellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.NumericCellValue); var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
if (!cellValue.HasValue || cellValue.Value == 0) if (!cellValue.HasValue || cellValue.Value == 0)
continue; continue;
......
...@@ -61,7 +61,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -61,7 +61,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (string.IsNullOrEmpty(accountingUnit)) if (string.IsNullOrEmpty(accountingUnit))
continue; continue;
var athead = vhead.ElementAt(c); var athead = vhead.ElementAt(c);
var cellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.NumericCellValue); var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
if (!cellValue.HasValue || cellValue.Value == 0) if (!cellValue.HasValue || cellValue.Value == 0)
continue; continue;
PerData data = new PerData PerData data = new PerData
......
...@@ -49,7 +49,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -49,7 +49,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (string.IsNullOrEmpty(accountingUnit)) if (string.IsNullOrEmpty(accountingUnit))
continue; continue;
var athead = vhead.ElementAt(c); var athead = vhead.ElementAt(c);
var cellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.NumericCellValue); var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
if (!cellValue.HasValue || cellValue.Value == 0) if (!cellValue.HasValue || cellValue.Value == 0)
continue; continue;
PerData data = new PerData PerData data = new PerData
......
...@@ -151,17 +151,17 @@ public SheetExportResponse SheetExport(int sheetID) ...@@ -151,17 +151,17 @@ public SheetExportResponse SheetExport(int sheetID)
{ {
if (head.CellValue.Contains("医生组")) if (head.CellValue.Contains("医生组"))
{ {
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.UnitType == 1).AccountingUnit; var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.UnitType == 1)?.AccountingUnit;
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1));
} }
else if (head.CellValue.Contains("护理组")) else if (head.CellValue.Contains("护理组"))
{ {
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.UnitType == 2).AccountingUnit; var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.UnitType == 2)?.AccountingUnit;
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1));
} }
else else
{ {
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber).AccountingUnit; var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber)?.AccountingUnit;
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1));
} }
} }
......
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