读取修改

parent b6f8d144
......@@ -54,6 +54,18 @@ public static T Deserialize<T>(string json)
}
/// <summary>
/// 将指定的 JSON 数据反序列化成指定对象。
/// </summary>
/// <typeparam name="T">对象类型。</typeparam>
/// <param name="json">JSON 数据。</param>
/// <returns></returns>
public static T Deserialize<T>(Dictionary<string, object> @object)
{
var json = JsonConvert.SerializeObject(@object, Formatting.None, _jsonSettings);
return JsonConvert.DeserializeObject<T>(json, _jsonSettings);
}
/// <summary>
/// 将转换后的Key全部设置为小写
/// </summary>
/// <param name="json"></param>
......
using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.Services
{
public class ExcelReadConfig
{
public static ColumnInfo[] Employee { get; set; } = new ColumnInfo[]
{
new ColumnInfo(nameof(PerDataEmployee.AccountingUnit), "核算单元" ),
new ColumnInfo(nameof(PerDataEmployee.Department), "核算单元"),
new ColumnInfo(nameof(PerDataEmployee.PersonnelNumber), "人员工号"),
new ColumnInfo(nameof(PerDataEmployee.DoctorName), "医生姓名"),
new ColumnInfo(nameof(PerDataEmployee.JobTitle), "职务分类"),
new ColumnInfo(nameof(PerDataEmployee.FitPeople), "绩效基数核算参考对象"),
new ColumnInfo(nameof(PerDataEmployee.FitPeopleValue), "绩效基础核算参考值", true),
new ColumnInfo(nameof(PerDataEmployee.FitPeopleRatio), "绩效基数核算系数", true),
new ColumnInfo(nameof(PerDataEmployee.AccountType), "人员分类"),
new ColumnInfo(nameof(PerDataEmployee.PostCoefficient), "岗位系数", true),
new ColumnInfo(nameof(PerDataEmployee.ScoreAverageRate), "考核得分率", true),
new ColumnInfo(nameof(PerDataEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataEmployee.Adjust), "调节系数", true),
};
public static ColumnInfo[] ClinicEmployee { get; set; } = new ColumnInfo[]
{
new ColumnInfo(nameof(PerDataClinicEmployee.UnitType), "核算单元分类"),
new ColumnInfo(nameof(PerDataClinicEmployee.AccountingUnit), "核算单元"),
new ColumnInfo(nameof(PerDataClinicEmployee.Department), "核算单元"),
new ColumnInfo(nameof(PerDataClinicEmployee.PersonnelNumber), "人员工号"),
new ColumnInfo(nameof(PerDataClinicEmployee.DoctorName), "医生姓名"),
new ColumnInfo(nameof(PerDataClinicEmployee.JobTitle), "职务分类"),
new ColumnInfo(nameof(PerDataClinicEmployee.Basics), "基础绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.PermanentStaff), "效率绩效人数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Efficiency), "效率绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Scale), "规模绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Management), "管理绩效发放系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.ScoreAverageRate), "考核得分率", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataClinicEmployee.OtheManagementPerfor), "其他管理绩效"),
new ColumnInfo(nameof(PerDataClinicEmployee.OthePerfor), "其他绩效"),
new ColumnInfo(nameof(PerDataClinicEmployee.Adjust), "调节系数", true),
};
public static ColumnInfo[] LogisticsEmployee { get; set; } = new ColumnInfo[]
{
new ColumnInfo(nameof(PerDataLogisticsEmployee.AccountType), "人员分类"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.AccountingUnit), "核算单元"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.FitPeople), "绩效基数核算参考对象"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.FitPeopleValue), "绩效基础核算参考值", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.FitPeopleRatio), "绩效基数核算系数", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.JobNumber), "人员工号"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.DoctorName), "人员姓名"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.JobTitle), "职务分类"),
new ColumnInfo(nameof(PerDataLogisticsEmployee.PostCoefficient), "岗位系数", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataLogisticsEmployee.OthePerfor), "其他绩效", true),
};
public static ColumnInfo[] AccountBaisc { get; set; } = new ColumnInfo[]
{
new ColumnInfo(nameof(PerDataAccountBaisc.UnitType), "核算单元类型"),
new ColumnInfo(nameof(PerDataAccountBaisc.AccountingUnit), "核算单元"),
new ColumnInfo(nameof(PerDataAccountBaisc.ManagerNumber), "科主任/护士长人数", true),
new ColumnInfo(nameof(PerDataAccountBaisc.Number), "核算单元人员数量", true),
new ColumnInfo(nameof(PerDataAccountBaisc.BasicFactor), "预算比例", true),
new ColumnInfo(nameof(PerDataAccountBaisc.OtherPerfor1), "其他绩效1", true),
new ColumnInfo(nameof(PerDataAccountBaisc.ScoringAverage), "考核得分率", true),
new ColumnInfo(nameof(PerDataAccountBaisc.AdjustFactor), "调节系数", true),
};
}
public class ColumnInfo
{
public ColumnInfo(string field, string description, bool isNumber = false)
{
Field = field;
Description = description;
IsNumber = isNumber;
}
public string Field { get; set; }
public string Description { get; set; }
public bool IsNumber { get; set; }
}
}
......@@ -21,61 +21,42 @@ public class PerSheetDataReadClinicEmployee : IPerSheetDataRead
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<IPerData> dataList = new List<IPerData>();
string[] headers = new string[]
{
"核算单元分类",
"核算单元",
"核算单元",
"人员工号",
"医生姓名",
"职务分类",
"基础绩效系数",
//"岗位系数",
"效率绩效人数",
"效率绩效系数",
"规模绩效系数",
"管理绩效发放系数",
"考核得分率",
"出勤率",
"其他管理绩效",
//"其他绩效",
//"医院奖罚",
"调节系数",
};
foreach (var item in headers)
{
if (!perHeader.Any(p => p.CellValue == item))
throw new NullReferenceException($"sheet '{sheet.SheetName}'中列'{item}'为空");
}
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
if (row == null) continue;
PerDataClinicEmployee clinicEmployee = new PerDataClinicEmployee();
Dictionary<string, object> dic = new Dictionary<string, object>
{
{ nameof(PerDataClinicEmployee.RowNumber), r}
};
foreach (var item in ExcelReadConfig.ClinicEmployee)
{
if (NopiSevice.TryGetPoint(perHeader, item.Description, out int point))
{
//var cell = row.GetCell(point);
//if (cell == null) continue;
//// 获取单元格格式
//var xxs = cell.CellStyle.DataFormat;
//var dataFormat = RecognitionDataFormat.GetDataFormat(xxs);
object @object = row.GetCell(point).GetValue();
if (item.IsNumber)
@object = ConvertHelper.To<decimal?>(@object);
if (dic.Keys.Contains(item.Field))
dic[item.Field] = @object;
else
dic.Add(item.Field, @object);
}
}
clinicEmployee.RowNumber = r;
clinicEmployee.UnitType = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元分类").PointCell));
clinicEmployee.AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell));
clinicEmployee.Department = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell));
clinicEmployee.PersonnelNumber = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell));
clinicEmployee.DoctorName = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell));
clinicEmployee.JobTitle = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职务分类").PointCell));
clinicEmployee.Basics = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础绩效系数").PointCell)?.NumericCellValue);
//clinicEmployee.PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue);
clinicEmployee.PermanentStaff = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效人数").PointCell)?.NumericCellValue);
clinicEmployee.Efficiency = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效系数").PointCell)?.NumericCellValue);
clinicEmployee.Scale = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "规模绩效系数").PointCell)?.NumericCellValue);
clinicEmployee.Management = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "管理绩效发放系数").PointCell)?.NumericCellValue);
clinicEmployee.ScoreAverageRate = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.NumericCellValue);
clinicEmployee.Attendance = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "出勤率").PointCell)?.NumericCellValue);
//clinicEmployee.OthePerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell)?.NumericCellValue);
//clinicEmployee.Punishment = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell)?.NumericCellValue);
clinicEmployee.OtheManagementPerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他管理绩效").PointCell)?.NumericCellValue);
clinicEmployee.Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.NumericCellValue);
var employee = JsonHelper.Deserialize<PerDataClinicEmployee>(dic);
if (!string.IsNullOrEmpty(clinicEmployee.UnitType) && !string.IsNullOrEmpty(clinicEmployee.DoctorName))
dataList.Add(clinicEmployee);
if (!string.IsNullOrEmpty(employee.UnitType) && !string.IsNullOrEmpty(employee.DoctorName))
dataList.Add(employee);
}
return dataList;
......
......@@ -24,99 +24,39 @@ public class PerSheetDataReadDeptAccounting : IPerSheetDataRead
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<IPerData> dataList = new List<IPerData>();
string[] headers = new string[]
{
"核算单元类型",
"核算单元",
//"科室名称",
//"效率绩效人数",
"科主任/护士长人数",
"核算单元人员数量",
"预算比例",
//"倾斜系数",
//"工作量倾斜系数",
//"保底绩效参考标准",
//"保底绩效系数",
//"其他绩效1",
//"其他绩效2",
//"药占比奖罚",
//"材料占比奖罚",
//"医院奖罚",
"考核得分率",
"调节系数",
};
foreach (var item in headers)
{
if (!perHeader.Any(p => p.CellValue == item))
throw new NullReferenceException($"sheet '{sheet.SheetName}'中列'{item}'为空");
}
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
if (row == null) continue;
PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc();
unifyUnit.RowNumber = r;
unifyUnit.UnitType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元类型").PointCell)?.StringCellValue;
unifyUnit.AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell));
//unifyUnit.Department = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室名称").PointCell));
//unifyUnit.PermanentStaff = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效人数").PointCell)?.NumericCellValue);
unifyUnit.ManagerNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科主任/护士长人数").PointCell)?.NumericCellValue);
unifyUnit.Number = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元人员数量").PointCell)?.NumericCellValue);
unifyUnit.BasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "预算比例").PointCell)?.NumericCellValue);
//unifyUnit.SlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数").PointCell)?.NumericCellValue);
//unifyUnit.Scale = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "规模绩效系数").PointCell)?.NumericCellValue);
//unifyUnit.Effic = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效系数").PointCell)?.NumericCellValue);
//unifyUnit.Grant = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "管理绩效发放系数").PointCell)?.NumericCellValue);工作量倾斜系数
//unifyUnit.WorkSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "工作量倾斜系数").PointCell)?.NumericCellValue);
//unifyUnit.MinimumReference = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "保底绩效参考标准").PointCell)?.StringCellValue;
//unifyUnit.MinimumFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "保底绩效系数").PointCell)?.NumericCellValue);
unifyUnit.OtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1").PointCell)?.NumericCellValue);
//unifyUnit.OtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2").PointCell)?.NumericCellValue);
//unifyUnit.MedicineExtra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "药占比奖罚").PointCell)?.NumericCellValue);
//unifyUnit.MaterialsExtra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "材料占比奖罚").PointCell)?.NumericCellValue);
//unifyUnit.Extra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell)?.NumericCellValue);
unifyUnit.ScoringAverage = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.NumericCellValue);
unifyUnit.AdjustFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.NumericCellValue);
Dictionary<string, object> dic = new Dictionary<string, object>
{
{ nameof(PerDataAccountBaisc.RowNumber), r}
};
//unifyUnit.NurseHeadNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元护士长数量" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元护士数量" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseBasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "预算比例" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseScale = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "规模绩效系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseEffic = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseGrant = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "管理绩效发放系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseOtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseOtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseExtra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseScoringAverage = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
//unifyUnit.NurseAdjustFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
foreach (var item in ExcelReadConfig.AccountBaisc)
{
if (NopiSevice.TryGetPoint(perHeader, item.Description, out int point))
{
object @object = row.GetCell(point).GetValue();
if (item.IsNumber)
@object = ConvertHelper.To<decimal?>(@object);
if (!string.IsNullOrEmpty(unifyUnit.UnitType))
dataList.Add(unifyUnit);
}
if (dic.Keys.Contains(item.Field))
dic[item.Field] = @object;
else
dic.Add(item.Field, @object);
}
}
return dataList;
}
var baisc = JsonHelper.Deserialize<PerDataAccountBaisc>(dic);
/// <summary>
/// 转换核算单元类型
/// </summary>
/// <param name="unitType"></param>
/// <returns></returns>
public int UnitType(string unitType)
{
switch (unitType)
{
case "医生组":
return 1;
case "护理组":
return 2;
case "医技组":
return 3;
default:
return 0;
if (!string.IsNullOrEmpty(baisc.UnitType))
dataList.Add(baisc);
}
return dataList;
}
}
}
......@@ -24,57 +24,34 @@ public class PerSheetDataReadEmployee : IPerSheetDataRead
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<IPerData> dataList = new List<IPerData>();
string[] headers = new string[]
{
"核算单元",
"人员工号",
"医生姓名",
"职务分类",
"绩效基数核算参考对象",
"绩效基础核算参考值",
"绩效基数核算系数",
"人员分类",
"岗位系数",
//"参加工作时间",
"考核得分率",
"出勤率",
//"其他绩效",
//"医院奖罚",
"调节系数",
};
foreach (var item in headers)
{
if (!perHeader.Any(p => p.CellValue == item))
throw new NullReferenceException($"sheet '{sheet.SheetName}'中列'{item}'为空");
}
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
if (row == null) continue;
PerDataEmployee employee = new PerDataEmployee
Dictionary<string, object> dic = new Dictionary<string, object>
{
RowNumber = r,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)),
Department = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)),
PersonnelNumber = NopiSevice.GetCellStringValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)),
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职务分类").PointCell)?.StringCellValue,
FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue,
FitPeopleValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基础核算参考值").PointCell)?.ToString()),
FitPeopleRatio = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算系数").PointCell)?.NumericCellValue),
AccountType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员分类").PointCell)?.StringCellValue,
PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue),
//WorkTime = NopiSevice.GetCellDatetimeValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "参加工作时间").PointCell)),
ScoreAverageRate = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.NumericCellValue),
Attendance = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "出勤率").PointCell)?.NumericCellValue),
//PeopleNumber = ConvertHelper.To<int?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元医生数").PointCell)?.ToString()),
//Workload = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "工作量绩效").PointCell)?.ToString()),
//OthePerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell)?.NumericCellValue),
//Punishment = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell)?.NumericCellValue),
Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.NumericCellValue),
//Grant = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "发放系数").PointCell)?.ToString()),
{ nameof(PerDataEmployee.RowNumber), r}
};
foreach (var item in ExcelReadConfig.Employee)
{
if (NopiSevice.TryGetPoint(perHeader, item.Description, out int point))
{
object @object = row.GetCell(point).GetValue();
if (item.IsNumber)
@object = ConvertHelper.To<decimal?>(@object);
if (dic.Keys.Contains(item.Field))
dic[item.Field] = @object;
else
dic.Add(item.Field, @object);
}
}
var employee = JsonHelper.Deserialize<PerDataEmployee>(dic);
if (!string.IsNullOrEmpty(employee.AccountingUnit) && !string.IsNullOrEmpty(employee.FitPeople))
dataList.Add(employee);
}
......
......@@ -30,44 +30,27 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var row = sheet.GetRow(r);
if (row == null) continue;
PerDataLogisticsEmployee employee = new PerDataLogisticsEmployee()
Dictionary<string, object> dic = new Dictionary<string, object>
{
RowNumber = r,
{ nameof(PerDataLogisticsEmployee.RowNumber), r}
};
int point = 0;
if (NopiSevice.TryGetPoint(perHeader, "人员分类", out point))
employee.AccountType = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "核算单元", out point))
employee.AccountingUnit = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "绩效基数核算参考对象", out point))
employee.FitPeople = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "绩效基础核算参考值", out point))
employee.FitPeopleValue = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "绩效基数核算系数", out point))
employee.FitPeopleRatio = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "人员工号", out point))
employee.JobNumber = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "人员姓名", out point))
employee.DoctorName = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "职务分类", out point))
employee.JobTitle = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "岗位系数", out point))
employee.PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "出勤率", out point))
employee.Attendance = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "其他绩效", out point))
employee.OthePerfor = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
foreach (var item in ExcelReadConfig.LogisticsEmployee)
{
if (NopiSevice.TryGetPoint(perHeader, item.Description, out int point))
{
object @object = row.GetCell(point).GetValue();
if (item.IsNumber)
@object = ConvertHelper.To<decimal?>(@object);
if (dic.Keys.Contains(item.Field))
dic[item.Field] = @object;
else
dic.Add(item.Field, @object);
}
}
var employee = JsonHelper.Deserialize<PerDataLogisticsEmployee>(dic);
if (!string.IsNullOrEmpty(employee.AccountingUnit) && !string.IsNullOrEmpty(employee.FitPeople))
dataList.Add(employee);
......
......@@ -51,13 +51,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
};
//AccountingUnit = accountingUnit,
//Department = accountingUnit,
//specialUnit.QuantitativeIndicators = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标").PointCell)?.StringCellValue;
//specialUnit.Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell)?.ToString());
//specialUnit.QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标绩效分值").PointCell)?.NumericCellValue);
int point = 0;
int point;
if (NopiSevice.TryGetPoint(perHeader, "量化指标", out point))
specialUnit.QuantitativeIndicators = row.GetCell(point).GetValue();
if (NopiSevice.TryGetPoint(perHeader, "数量", out point))
......@@ -67,14 +61,18 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (NopiSevice.TryGetPoint(perHeader, "人数", out point))
specialUnit.Number = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
ICell cell = null;
if (NopiSevice.TryGetPoint(perHeader, "科室", out int kspoint))
cell = row.GetCell(kspoint);
if (cell == null) continue;
var cell = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell);//?.ToString();
var accountingUnit = NopiSevice.GetCellStringValue(cell);
var accountingUnit = cell.GetValue();
if (cell != null && IsMergeCell(cell, out Point start, out Point end) && r != start.X)
{
row = sheet.GetRow(start.X);
cell = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell);
accountingUnit = cell?.StringCellValue;
cell = row.GetCell(kspoint);
accountingUnit = cell.GetValue();
}
if (string.IsNullOrEmpty(accountingUnit))
accountingUnit = lastAccount;
......@@ -84,8 +82,6 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
specialUnit.AccountingUnit = accountingUnit;
specialUnit.Department = accountingUnit;
//specialUnit.Number = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人数").PointCell)?.NumericCellValue);
//specialUnit.ScoringAverage = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.NumericCellValue);
//specialUnit.OtherPerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell)?.NumericCellValue);
//specialUnit.Punishment = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell)?.NumericCellValue);
......
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