Commit cdbe954e by lcx

Merge branch 'v2020morge' into v2020morge-graphql

parents 3604709a 85bc3234
......@@ -17,5 +17,9 @@ public class SpecialUnitColumns
public const string TargetFactor = "量化指标绩效分值";
public const string AdjustFactor = "调节系数";
public const string AssessBefore = "考核前绩效";
public const string Avg = "人均";
}
}
......@@ -144,6 +144,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
for (int sheetIndex = 0; sheetIndex < workbook.NumberOfSheets; sheetIndex++)
{
var sheet = workbook.GetSheetAt(sheetIndex);
string sheetName = sheet.SheetName.NoBlank();
ratio += 40m / workbook.NumberOfSheets;
var sheetType = perSheetService.GetSheetType(sheet.SheetName);
......@@ -156,13 +157,14 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
if (sheetType == SheetType.OtherWorkload) point = PerSheetDataFactory.GetDataRead(SheetType.Workload)?.Point;
if (types.Contains(sheetType) && point != null && point.DataFirstCellNum.HasValue)
{
logger.LogInformation($"{sheetName}开始清除历史数据。point:{JsonHelper.Serialize(point)}");
ExtractHelper.ClearSheetPartialData(sheet, point, sheetType);
}
var customer = factory.GetWriteData(sheetType, logger);
if (customer != null)
{
string sheetName = sheet.SheetName.NoBlank();
var collects = collectData?.Where(t => t.SheetName.NoBlank() == sheetName).ToList();
customer.WriteCollectData(sheet, point, sheetType, style, collects, exdict);
......
......@@ -189,10 +189,13 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
if (special != null)
{
var cell = row.GetOrCreate(quantityIndex);
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(special.Quantity);
cell.CellStyle = cellStyle;
if (cell.CellType != CellType.Formula)
{
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(special.Quantity);
cell.CellStyle = cellStyle;
}
specials.Remove(special);
}
dataFirstRowNum = rowIndex + 1;
......@@ -321,7 +324,14 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s
if (columns == null || !columns.Any()) return;
if (ranges == null || !ranges.Any()) return;
var columnIndexs = new string[] { SpecialUnitColumns.Department, SpecialUnitColumns.PeopleNumber, SpecialUnitColumns.AdjustFactor }.Select(t => columns.IndexOf(t));
var columnIndexs = new string[]
{
SpecialUnitColumns.Department,
SpecialUnitColumns.PeopleNumber,
SpecialUnitColumns.AdjustFactor,
SpecialUnitColumns.AssessBefore,
SpecialUnitColumns.Avg
}.Select(t => columns.IndexOf(t));
if (columnIndexs == null || !columnIndexs.Any(t => t > -1)) return;
foreach (var index in columnIndexs.Where(t => t > -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