bug版

parent 7880990d
......@@ -113,11 +113,11 @@ public void ConfigureServices(IServiceCollection services)
var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
RedisHelper.Initialization(csredis);
//后台任务调度
services.AddHangfire(config =>
{
config.UseRedisStorage(connection.Value.HangfireRedisConnectionString);
});
////后台任务调度
//services.AddHangfire(config =>
//{
// config.UseRedisStorage(connection.Value.HangfireRedisConnectionString);
//});
services.AddDbContext<PerformanceDbContext>(options =>
{
......@@ -148,8 +148,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
// c.RoutePrefix = string.Empty;
//});
app.UseHangfireServer();
app.UseHangfireDashboard();
//app.UseHangfireServer();
//app.UseHangfireDashboard();
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
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)
//else
if (sheetName.StartsWith("1.0"))
return SheetType.OtherIncome;
//else if (sheetName.StartsWith("1.1"))
//return SheetType.Income;
else if (sheetName.StartsWith("1.1"))
return SheetType.Income;
else if (sheetName.StartsWith("2."))
return SheetType.Expend;
else if (sheetName.StartsWith("3."))
......
......@@ -87,7 +87,7 @@ public PerSheet MergeCompute(PerExcel excel)
private string GetCleanSheetName(string sheetName)
{
sheetName = sheetName
sheetName = sheetName.Trim()
.Replace("医生组", "")
.Replace("护理组", "")
.Replace(".", "");
......
......@@ -65,7 +65,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
continue;
if (!string.IsNullOrEmpty(athead?.CellValue) && athead.CellValue.Contains("备注"))
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)
continue;
......
......@@ -61,7 +61,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (string.IsNullOrEmpty(accountingUnit))
continue;
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)
continue;
PerData data = new PerData
......
......@@ -49,7 +49,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (string.IsNullOrEmpty(accountingUnit))
continue;
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)
continue;
PerData data = new PerData
......
......@@ -151,17 +151,17 @@ public SheetExportResponse SheetExport(int sheetID)
{
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));
}
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));
}
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));
}
}
......
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