Commit a0715198 by lcx

核算单元取值(num,string混乱)生成错误

parent 5c9af07b
......@@ -286,6 +286,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
new { AccountUnitType = AccountUnitType.科主任, UnitType = UnitType.医生组 },
new { AccountUnitType = AccountUnitType.护士长, UnitType = UnitType.护理组 },
new { AccountUnitType = AccountUnitType.科主任, UnitType = UnitType.医技组 },
new { AccountUnitType = AccountUnitType.Null, UnitType = UnitType.其他 },
};
//取出科室
List<res_account> dataList = new List<res_account>();
......
......@@ -19,11 +19,11 @@ public static string GetCellStringValue(ICell cell)
switch (cell.CellType)
{
case CellType.Numeric:
return cell.NumericCellValue.ToString();
return cell.NumericCellValue.ToString().Replace("0", "");
case CellType.String:
return cell.StringCellValue.ToString();
return cell.StringCellValue.ToString().Replace("0", "");
case CellType.Formula:
return cell.NumericCellValue.ToString();
return cell.NumericCellValue.ToString().Replace("0", "");
}
}
catch (Exception ex)
......
......@@ -75,8 +75,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.StringCellValue,
Department = row.GetCell(unit.DeptCellNum.Value)?.StringCellValue,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
......
......@@ -54,9 +54,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
UnitType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元分类").PointCell)?.StringCellValue,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
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,
Basics = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础绩效系数").PointCell)?.NumericCellValue),
......
......@@ -56,8 +56,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc();
unifyUnit.RowNumber = r;
unifyUnit.UnitType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元类型").PointCell)?.StringCellValue;
unifyUnit.AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue;
unifyUnit.Department = 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);
......
......@@ -53,20 +53,22 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.StringCellValue,
Department = row.GetCell(unit.DeptCellNum.Value)?.StringCellValue,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = row.GetCell(0).ToString(),
UnitType = row.GetCell(0)?.ToString(),
FactorValue = 0,
IsFactor = false,
};
if (sheet.SheetName.Contains("医生组"))
data.UnitType = "医生组";
else if (sheet.SheetName.Contains("护理组"))
data.UnitType = "护理组";
if (!string.IsNullOrEmpty(data.UnitType))
dataList.Add(data);
}
}
......
......@@ -55,9 +55,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
PerDataEmployee employee = new PerDataEmployee
{
RowNumber = r,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
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,
......
......@@ -78,8 +78,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.StringCellValue,
Department = row.GetCell(unit.DeptCellNum.Value)?.StringCellValue,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
......@@ -90,6 +90,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var lastcell = vhead.OrderByDescending(t => t.PointCell).First();
if (lastcell.CellValue.Contains("备注"))
data.Remark = row.GetCell(lastcell.PointCell)?.StringCellValue;
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
}
}
......
......@@ -82,6 +82,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.NumericCellValue),
IsFactor = true,
};
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
}
}
......
......@@ -73,8 +73,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.StringCellValue,
Department = row.GetCell(unit.DeptCellNum.Value)?.StringCellValue,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
......@@ -82,6 +82,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.NumericCellValue),
IsFactor = true,
};
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
}
}
......
......@@ -57,7 +57,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标绩效分值").PointCell)?.NumericCellValue),
};
var cell = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell);//?.ToString();
var accountingUnit = cell?.StringCellValue;
var accountingUnit = NopiSevice.GetCellStringValue(cell);
if (cell != null && IsMergeCell(cell, out Point start, out Point end) && r != start.X)
{
row = sheet.GetRow(start.X);
......
......@@ -54,8 +54,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.StringCellValue,
Department = row.GetCell(unit.DeptCellNum.Value)?.StringCellValue,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
......@@ -68,6 +68,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
else if (sheet.SheetName.Contains("护理组"))
data.UnitType = "护理组";
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
}
}
......
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