Commit 93716191 by lcx

提取数据时,4.1补充科室,5.x~6.x的核算单元和4.1中保持一致;录入数据时5.x~6.x没有数据时,默认带出4.1科室

parent 50089301
......@@ -416,6 +416,7 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
/// </summary>
/// <returns></returns>
[Route("api/second/other/save")]
[HttpPost]
public ApiResponse OtherSave([FromBody] AgOtherRequest request)
{
var result = secondAllotService.OtherSave(request.SecondId, request.Othersources);
......
//-----------------------------------------------------------------------
// <copyright file=" per_dept_dic.cs">
// * FileName: per_dept_dic.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// per_dept_dic Repository
/// </summary>
public partial class PerforPerdeptdicRepository : PerforRepository<per_dept_dic>
{
public IEnumerable<per_dept_dic> GetAccountBasicAccountingUnit(int hospitalId)
{
string sql = @"select * from
(
select distinct
unittype,
ifnull
(
max(case when source = '门诊' then accountingunit end),
max(case when source = '住院' then accountingunit end)
) accountingunit
from per_dept_dic
where hospitalid = @hospitalId
group by unittype,department,hisdeptname
) t
where ifnull(accountingunit, '无')<>'无'
order by unittype,accountingunit;";
return DapperQuery<per_dept_dic>(sql, new { hospitalId });
}
}
}
......@@ -17,25 +17,5 @@ public partial class PerforPerdeptdicRepository : PerforRepository<per_dept_dic>
public PerforPerdeptdicRepository(PerformanceDbContext context) : base(context)
{
}
public IEnumerable<per_dept_dic> GetAccountBasicAccountingUnit(int hospitalId)
{
string sql = @"select * from
(
select distinct
unittype,
ifnull
(
max(case when source = '' then accountingunit end),
max(case when source = 'סԺ' then accountingunit end)
) accountingunit
from per_dept_dic
where hospitalid = @hospitalId
group by unittype,department,hisdeptname
) t
where ifnull(accountingunit, '')<>''
order by unittype,accountingunit;";
return DapperQuery<per_dept_dic>(sql, new { hospitalId });
}
}
}
......@@ -273,6 +273,7 @@ private IEnumerable<collect_permission> GetCollectSheetByAllot(int hospitalId, i
}
#region 加载采集内容
/// <summary>
/// 加载采集内容
/// </summary>
......@@ -320,7 +321,6 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
if (permissions == null || !permissions.Any())
throw new PerformanceException("用户没有权限编辑当前SHEET页");
List<HandsonRowData> rowDatas = null;
var collectdata = perforcollectdataRepository.GetEntities(w => w.SheetName == sheet.SheetName && w.AllotID == allotId);
if (collectdata != null)
......@@ -336,6 +336,8 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
config = CollectDataConfig.PersonExtra;
else if (sheet.SheetType == (int)SheetType.AccountBasic)
config = CollectDataConfig.AccountBasic;
else if (CollectDataConfig.AccountExrtaType.Contains(sheet.SheetType.Value))
config = CollectDataConfig.AccountExtra;
else
config = CollectDataConfig.Default;
......@@ -371,6 +373,9 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
rowDatas = GetCommonData(sheet);
}
if (rowDatas == null || !rowDatas.Any())
rowDatas = GetAccountExtra(allot, sheet.SheetType.Value);
rowDatas?.RemoveAll(t => !t.CellData.Any(w => !string.IsNullOrEmpty(w.Value?.ToString())));
if (rowDatas != null && rowDatas.Any())
rowDatas = rowDatas.OrderBy(t => t.Row).ToList();
......@@ -397,20 +402,20 @@ private List<HandsonRowData> GetCommonData(per_sheet sheet)
var units = rowdata.Where(w => w.UnitType.HasValue).Select(w => new { w.UnitType, w.AccountingUnit }).Distinct();
foreach (var item in units)
{
if ((new[] {(int) UnitType.医生组, (int) UnitType.其他医生组}).Contains(item.UnitType.Value))
if ((new[] { (int)UnitType.医生组, (int)UnitType.其他医生组 }).Contains(item.UnitType.Value))
{
setdata.Add(new HandsonCellData("核算单元(医生组)", item.AccountingUnit));
GetUnitClassification(setdata,UnitType.医生组,sheet);
GetUnitClassification(setdata, UnitType.医生组, sheet);
}
else if ((new[] {(int) UnitType.医技组, (int) UnitType.其他医技组}).Contains(item.UnitType.Value))
else if ((new[] { (int)UnitType.医技组, (int)UnitType.其他医技组 }).Contains(item.UnitType.Value))
{
setdata.Add(new HandsonCellData("核算单元(医技组)", item.AccountingUnit));
GetUnitClassification(setdata,UnitType.医技组,sheet);
GetUnitClassification(setdata, UnitType.医技组, sheet);
}
else if ((new[] {(int) UnitType.护理组, (int) UnitType.其他护理组}).Contains(item.UnitType.Value))
else if ((new[] { (int)UnitType.护理组, (int)UnitType.其他护理组 }).Contains(item.UnitType.Value))
{
setdata.Add(new HandsonCellData("核算单元(护理组)", item.AccountingUnit));
GetUnitClassification(setdata,UnitType.护理组,sheet);
GetUnitClassification(setdata, UnitType.护理组, sheet);
}
setdata.Add(new HandsonCellData("核算单元", item.AccountingUnit));
}
......@@ -460,6 +465,45 @@ private List<HandsonRowData> GerEmployee(per_sheet sheet)
return new List<HandsonRowData>();
}
private List<HandsonRowData> GetAccountExtra(per_allot allot, int sheetType)
{
List<HandsonRowData> handsonRows = new List<HandsonRowData>();
if (!CollectDataConfig.AccountExrtaType.Contains(sheetType)) return handsonRows;
List<im_data> basicData = new List<im_data>();
var sheet = perforPersheetRepository.GetEntity(w => w.AllotID == allot.ID && w.SheetType == (int)SheetType.AccountBasic);
if (sheet != null)
{
basicData = perforImdataRepository.GetEntities(t => t.SheetID == sheet.ID);
}
else
{
var allotStates = new int[] { (int)AllotStates.Archive, (int)AllotStates.GenerateSucceed, (int)AllotStates.GenerateAccomplish };
var allots = perforPerallotRepository.GetEntities(t => t.HospitalId == allot.HospitalId && allotStates.Contains(t.States) && t.Year < allot.Year && t.Month < allot.Month);
var prevAllot = allots.LastOrDefault();
if (prevAllot == null) return handsonRows;
sheet = perforPersheetRepository.GetEntity(w => w.AllotID == prevAllot.ID && w.SheetType == (int)SheetType.AccountBasic);
basicData = perforImdataRepository.GetEntities(t => t.SheetID == sheet.ID);
}
if (basicData == null || !basicData.Any()) return handsonRows;
var data = basicData.Select(t => new { t.RowNumber, UnitType = ((UnitType)t.UnitType).ToString(), t.AccountingUnit }).ToDistinct().OrderBy(t => t.RowNumber);
foreach (var item in data)
{
List<HandsonCellData> handsonCells = new List<HandsonCellData>();
handsonCells.Add(new HandsonCellData("核算单元类型", item.UnitType));
handsonCells.Add(new HandsonCellData("核算单元", item.AccountingUnit));
handsonRows.Add(new HandsonRowData(item.RowNumber.Value, handsonCells));
}
return handsonRows;
}
private HandsonRowData CreateRowData(int row, ColumnInfo[] columns, SortedDictionary<string, object> dic)
{
......@@ -477,10 +521,10 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
var groupAccount = perforImdataRepository.GetEntities(t => t.SheetID == sheet.ID); //.OrderBy(c=>c.RowNumber).GroupBy(c => c.RowNumber);
if (groupAccount != null && groupAccount.Any())
{
foreach (var rowNumber in groupAccount.Select(t=>t.RowNumber).Distinct())
foreach (var rowNumber in groupAccount.Select(t => t.RowNumber).Distinct())
{
var numberData = groupAccount.Where(t => t.RowNumber == rowNumber);
var accountUnit = new HandsonCellData("核算单元",numberData.First().AccountingUnit);
var accountUnit = new HandsonCellData("核算单元", numberData.First().AccountingUnit);
var data = numberData?.Select(t => new HandsonCellData(t.TypeName, t.CellValue)).ToList();
data.Add(accountUnit);
......@@ -490,23 +534,25 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
var unitType = new HandsonCellData("核算单元类型", UnitType.医技组);
data.Add(unitType);
break;
case (int)UnitType.医生组:
unitType = new HandsonCellData("核算单元类型", UnitType.医生组);
data.Add(unitType);
break;
case (int)UnitType.护理组:
unitType = new HandsonCellData("核算单元类型", UnitType.护理组);
data.Add(unitType);
break;
case (int)UnitType.特殊核算组:
unitType = new HandsonCellData("核算单元类型", UnitType.特殊核算组);
data.Add(unitType);
break;
}
var rowData = new HandsonRowData(rowNumber.Value,data);
var rowData = new HandsonRowData(rowNumber.Value, data);
result.Add(rowData);
}
//var temps = accounts.Row.Select(item => new { row = item.Rownumber, dic = JsonHelper.Deserialize(item) });
......@@ -516,7 +562,7 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
return result;
}
private void GetUnitClassification(List<HandsonCellData> setdata,UnitType unitType,per_sheet sheet)
private void GetUnitClassification(List<HandsonCellData> setdata, UnitType unitType, per_sheet sheet)
{
if (sheet.SheetType == (int)SheetType.AccountExtra)
setdata.Add(new HandsonCellData("核算组别", unitType));
......@@ -525,13 +571,16 @@ private void GetUnitClassification(List<HandsonCellData> setdata,UnitType unitTy
else if (sheet.SheetType == (int)SheetType.BudgetRatio)
setdata.Add(new HandsonCellData("核算单元类型", unitType));
}
#endregion
#endregion 加载采集内容
public void SaveCollectData(int allotId, SaveCollectData request)
{
var types = new[] { (int)SheetType.Employee, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload,
var types = new List<int> { (int)SheetType.Employee, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload,
(int)SheetType.ClinicEmployee, (int)SheetType.AccountExtra, (int)SheetType.PersonExtra, (int)SheetType.LogisticsEmployee};
types.AddRange(CollectDataConfig.AccountExrtaType);
if (!types.Contains(request.SheetType))
throw new PerformanceException("当前SHEET页信息错误");
......@@ -550,10 +599,11 @@ public void SaveCollectData(int allotId, SaveCollectData request)
config = CollectDataConfig.LogisticsEmployee;
else if (request.SheetType == (int)SheetType.PersonExtra)
config = CollectDataConfig.PersonExtra;
else if (CollectDataConfig.AccountExrtaType.Contains(request.SheetType))
config = CollectDataConfig.AccountExtra;
else
config = CollectDataConfig.Default;
var dicData = CreateDataRow(allotId, request, config);
List<collect_data> datas = new List<collect_data>();
foreach (var item in dicData)
......@@ -659,6 +709,15 @@ public class CollectDataConfig
{ nameof(collect_data.EmployeeName), "医生姓名" },
};
public static Dictionary<string, string> AccountExtra { get; } = new Dictionary<string, string>
{
{ nameof(collect_data.UnitType), "核算单元类型" },
{ nameof(collect_data.AccountingUnitDoctor), "核算单元" },
{ nameof(collect_data.Department), "核算单元" },
{ nameof(collect_data.JobNumber), "人员工号" },
{ nameof(collect_data.EmployeeName), "医生姓名" },
};
public static Dictionary<string, string> AccountBasic { get; } = new Dictionary<string, string>
{
{ nameof(collect_data.UnitType), "核算单元分类" },
......@@ -678,5 +737,19 @@ public class CollectDataConfig
{ nameof(collect_data.JobNumber), "人员工号" },
{ nameof(collect_data.EmployeeName), "医生姓名" },
};
public static List<int> AccountExrtaType = new List<int>
{
(int)SheetType.AccountExtra,
(int)SheetType.AccountDrugAssess,
(int)SheetType.AccountMaterialsAssess,
(int)SheetType.AccountScoreAverage,
(int)SheetType.BudgetRatio,
(int)SheetType.AssessBeforeOtherFee,
(int)SheetType.AccountAdjustLaterOtherFee,
(int)SheetType.WorkloadMedicineProp,
(int)SheetType.WorkloadCMI,
(int)SheetType.WorkloadIncline,
};
}
}
......@@ -38,7 +38,7 @@ private static (string TempPath, string FilePath) CopyOriginalFile(int hospitalI
FileHelper.CreateDirectory(dpath);
string tempPath = Path.Combine(dpath, $"Template{DateTime.Now.ToString("yyyyMMddHHmmssfff")}{ext}");
FileHelper.Copy(originalPath, tempPath);
string filePath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xls");
string filePath = Path.Combine(dpath, $"绩效提取数据{DateTime.Now.ToString("yyyyMMddHHmmssfff")}{ext}");
return (tempPath, filePath);
}
......
......@@ -164,7 +164,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
string sheetName = sheet.SheetName.NoBlank();
var collects = collectData?.Where(t => t.SheetName.NoBlank() == sheetName).ToList();
customer.WriteCollectData(sheet, point, sheetType, style, collects);
customer.WriteCollectData(sheet, point, sheetType, style, collects, exdict);
var exdata = extractDto.Where(t => t.SheetName.NoBlank() == sheetName)?.ToList();
if (exdata != null)
......
......@@ -16,6 +16,7 @@ public enum ExDataDict
ExModule = 1,
ExItem = 2,
ExSpecial = 3,
AccountingBasic = 4,
}
public class QueryService : IAutoInjection
......
using NPOI.SS.UserModel;
using Microsoft.Extensions.Logging;
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.EntityModels;
using System;
......@@ -10,7 +11,14 @@ namespace Performance.Services.ExtractExcelService.SheetDataWrite
{
public class AccountBasicDataWrite : ISheetDataWrite
{
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
private readonly ILogger logger;
public AccountBasicDataWrite(ILogger logger)
{
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
}
......@@ -20,12 +28,38 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
{
int dataFirstRowNum = point.DataFirstRowNum.Value;
var accountingUnits = departments.Select(t => new
var accountingUnits = departments.Select(t => new Account
{
UnitType = t.UnitType.NoBlank(),
AccountingUnit = t.AccountingUnit.NoBlank()
}).ToList();
var tuples = GetAccountingUnitDataNonexistent(sheet, point, accountingUnits);
if (accountingUnits == null || !accountingUnits.Any()) return;
WriteAccountingUnitDataNonexistent(sheet, point, style, accountingUnits, tuples);
var accountBasic = new List<Account>();
for (int i = point.DataFirstRowNum.Value; i < sheet.LastRowNum + accountingUnits.Count + 1; i++)
{
var row = sheet.GetRow(i);
if (row == null) continue;
accountBasic.Add(new Account
{
UnitType = row.GetCell(point.DataFirstCellNum.Value - 2).GetDecodeEscapes(),
AccountingUnit = row.GetCell(point.DataFirstCellNum.Value - 1).GetDecodeEscapes()
});
}
exdict.Add(ExDataDict.AccountingBasic, accountBasic);
}
}
private List<Account> GetAccountingUnitDataNonexistent(ISheet sheet, PerSheetPoint point, List<Account> accountingUnits)
{
var tuples = new List<Account>();
for (int i = point.DataFirstRowNum.Value; i < sheet.LastRowNum + 1; i++)
......@@ -34,7 +68,7 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
if (row == null) continue;
var unittype = row.GetCell(point.DataFirstCellNum.Value - 2).GetDecodeEscapes();
var accountingunit = row.GetCell(point.DataFirstCellNum.Value - 2).GetDecodeEscapes();
var accountingunit = row.GetCell(point.DataFirstCellNum.Value - 1).GetDecodeEscapes();
if (!tuples.Any())
tuples.Add(new Account(unittype, i, i));
......@@ -51,12 +85,39 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
if (account != null) accountingUnits.Remove(account);
}
if (accountingUnits == null || !accountingUnits.Any()) return;
return tuples;
}
private void WriteAccountingUnitDataNonexistent(ISheet sheet, PerSheetPoint point, ExcelStyle style, List<Account> accountingUnits, List<Account> tuples)
{
int number = 0;
var deptStyle = style.GetCellStyle();
foreach (var unitType in tuples.Select(t => t.UnitType).Distinct())
{
var accountingList = accountingUnits.Where(t => t.UnitType == unitType)?.ToList();
if (accountingList == null || !accountingList.Any()) continue;
var tuple = tuples.First(t => t.UnitType == unitType);
sheet.ShiftRows(tuple.EndIndex + 1 + number, sheet.LastRowNum + number, accountingList.Count);
int index = tuple.EndIndex + 1 + number;
foreach (var acccount in accountingList)
{
var row = sheet.GetOrCreate(index);
var unitTypeCell = row.GetOrCreate(point.DataFirstCellNum.Value - 2);
unitTypeCell.SetCellValue<string>(acccount.UnitType);
unitTypeCell.CellStyle = deptStyle;
var accountingUnitCell = row.GetOrCreate(point.DataFirstCellNum.Value - 1);
accountingUnitCell.SetCellValue<string>(acccount.AccountingUnit);
accountingUnitCell.CellStyle = deptStyle;
index++;
}
number += accountingList.Count;
}
}
}
......@@ -76,6 +137,8 @@ public Account(string unitType, int beginIndex, int endIndex)
public string UnitType { get; set; }
public string AccountingUnit { get; set; }
public int BeginIndex { get; set; }
public int EndIndex { get; set; }
......
using Microsoft.Extensions.Logging;
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services.ExtractExcelService.SheetDataWrite
{
public class AccountExtraDataWrite : ISheetDataWrite
{
private readonly ILogger logger;
public AccountExtraDataWrite(ILogger logger)
{
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
point = new PerSheetPoint
{
HeaderFirstRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
DataFirstCellNum = 0
};
var accounts = new List<Account>();
if (exdict != null && exdict.ContainsKey(ExDataDict.AccountingBasic) && exdict[ExDataDict.AccountingBasic] != null)
accounts = exdict[ExDataDict.AccountingBasic] as List<Account> ?? new List<Account>();
ExtractHelper.ClearSheetPartialData(sheet, point, sheetType);
var columns = new List<string>();
if (collects != null && collects.Any(t => !string.IsNullOrEmpty(t.TypeName)))
{
columns = collects.Where(t => !string.IsNullOrEmpty(t.TypeName)).Select(t => t.TypeName).Distinct().OrderBy(t => t).ToList();
var headers = columns.Select(t => new ExcelHeader
{
ColumnName = t.NoBlank(),
DoctorFactor = 0,
NurseFactor = 0,
TechnicianFactor = 0
}).ToList();
WriteSheetHeader(sheet, point, sheetType, style, headers);
}
WriteCollectData(sheet, point, sheetType, style, columns, collects, accounts);
}
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null)
{
}
private void WriteSheetHeader(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<ExcelHeader> headers)
{
if (headers == null || !headers.Any()) return;
var columns = headers.Select(t => t).ToList();
// 费用类型
var columnHeader = sheet.GetOrCreate(point.HeaderFirstRowNum.Value);
// 去除excel中已存在的列
int headerFirstCellNum = point.DataFirstCellNum.Value;
if (columnHeader.LastCellNum > point.DataFirstCellNum.Value)
{
for (int index = point.DataFirstCellNum.Value; index < columnHeader.LastCellNum; index++)
{
var column = columnHeader.GetCell(index).GetDecodeEscapes();
if (string.IsNullOrEmpty(column)) continue;
if (index > headerFirstCellNum) headerFirstCellNum = index;
columns.RemoveAll(t => t.ColumnName.NoBlank() == column);
}
if (headerFirstCellNum > point.DataFirstCellNum.Value)
headerFirstCellNum += 1;
}
if (columns == null || !columns.Any()) return;
var columnStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.列头);
// 补充excel中不存在的列
foreach (var item in columns)
{
var columnCell = columnHeader.GetOrCreate(headerFirstCellNum);
columnCell.SetCellValue(item.ColumnName);
columnCell.CellStyle = columnStyle;
headerFirstCellNum++;
}
}
private void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<string> headers, List<collect_data> data, List<Account> accounts)
{
var columnHeader = sheet.GetOrCreate(point.HeaderFirstRowNum.Value);
int dataFirstRowNum = point.DataFirstRowNum.Value;
data = data ?? new List<collect_data>();
accounts = accounts.Any() ? accounts : data.Select(s => new Account { AccountingUnit = s.Department, UnitType = s.UnitType })
.Where(w => !string.IsNullOrEmpty(w.AccountingUnit)).ToDistinct().ToList();
var deptStyle = style.GetCellStyle();
var cellStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.数据);
headers = headers.Select(t => t.NoBlank()).ToList();
foreach (var account in accounts)
{
var deptData = data.Where(t => t.AccountingUnitDoctor == account.AccountingUnit && t.UnitType == account.UnitType);
var hasData = deptData != null && deptData.Any();
var row = sheet.GetOrCreate(dataFirstRowNum);
for (int cellIndex = point.HeaderFirstCellNum.Value; cellIndex < columnHeader.LastCellNum; cellIndex++)
{
var column = columnHeader.GetOrCreate(cellIndex).GetDecodeEscapes();
var cell = row.GetOrCreate(cellIndex);
if (collectExtra.ContainsKey(column))
{
cell.SetCellOValue(collectExtra[column]?.Invoke(account));
cell.CellStyle = deptStyle;
}
else if (hasData && headers != null && headers.Contains(column))
{
var value = deptData.FirstOrDefault(t => t.TypeName.NoBlank() == column)?.CellValue;
cell.SetCellValue<decimal>(value);
cell.CellStyle = cellStyle;
}
}
dataFirstRowNum++;
}
}
/// <summary> 收入固定列 </summary>
private static readonly Dictionary<string, Func<Account, string>> collectExtra = new Dictionary<string, Func<Account, string>>
{
{ "核算单元类型", (dto) => dto.UnitType },
{ "核算单元", (dto) => dto.AccountingUnit },
};
}
}
......@@ -7,16 +7,14 @@
namespace Performance.Services.ExtractExcelService.SheetDataWrite
{
class ClinicEmployeeDataWrite : ISheetDataWrite
internal class ClinicEmployeeDataWrite : ISheetDataWrite
{
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
}
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null)
{
}
}
}
......@@ -18,7 +18,7 @@ public DepartmentDataWrite(ILogger logger)
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
if (collects == null || !collects.Any(t => !string.IsNullOrEmpty(t.TypeName))) return;
......@@ -26,7 +26,7 @@ public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetT
var headers = columns.Select(t => new ExcelHeader
{
ColumnName = t.Trim(),
ColumnName = t.NoBlank(),
DoctorFactor = 0,
NurseFactor = 0,
TechnicianFactor = 0
......
......@@ -10,9 +10,8 @@ namespace Performance.Services.ExtractExcelService.SheetDataWrite
{
public class EmployeeDataWrite : ISheetDataWrite
{
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
}
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict)
......@@ -68,7 +67,6 @@ private void ClearSheetPartialData(ISheet sheet, List<per_employee> employees, L
var employee = employees.FirstOrDefault(t => t.AccountingUnit == accountingUnit && t.PersonnelNumber == personnel && t.DoctorName == doctorName);
if (employee == null)
{
}
else
{
......
......@@ -17,7 +17,7 @@ public interface ISheetDataWrite
/// <param name="sheetType"></param>
/// <param name="style"></param>
/// <param name="collects">采集数据</param>
void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects);
void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null);
/// <summary>
/// 写入抽取数据
......
......@@ -18,7 +18,7 @@ public IncomeDataWrite(ILogger logger)
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
if (collects == null || !collects.Any(t => !string.IsNullOrEmpty(t.TypeName))) return;
......
......@@ -18,7 +18,7 @@ public OtherIncomeDataWrite(ILogger logger)
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
if (collects == null || !collects.Any(t => !string.IsNullOrEmpty(t.TypeName))) return;
......
......@@ -20,7 +20,7 @@ public SpecialUnitDataWrite(ILogger logger)
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
}
......
......@@ -18,7 +18,7 @@ public WorkloadDataWrite(ILogger logger)
this.logger = logger;
}
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects, Dictionary<ExDataDict, object> exdict = null)
{
if (collects == null || !collects.Any(t => !string.IsNullOrEmpty(t.TypeName))) return;
......
......@@ -37,19 +37,32 @@ public ISheetDataWrite GetWriteData(SheetType sheetType, ILogger logger)
break;
case SheetType.AccountBasic:
factory = new AccountBasicDataWrite();
factory = new AccountBasicDataWrite(logger);
break;
case SheetType.SpecialUnit:
factory = new SpecialUnitDataWrite(logger);
break;
//case SheetType.AccountExtra:
//case SheetType.PersonExtra:
//case SheetType.AccountScoreAverage:
//case SheetType.BudgetRatio:
//case SheetType.AssessBeforeOtherFee:
// factory = new DepartmentDataWrite(logger);
// break;
case SheetType.AccountExtra:
case SheetType.PersonExtra:
case SheetType.AccountDrugAssess:
case SheetType.AccountMaterialsAssess:
case SheetType.AccountScoreAverage:
case SheetType.BudgetRatio:
case SheetType.AssessBeforeOtherFee:
factory = new DepartmentDataWrite(logger);
case SheetType.AccountAdjustLaterOtherFee:
case SheetType.WorkloadMedicineProp:
case SheetType.WorkloadCMI:
case SheetType.WorkloadIncline:
factory = new AccountExtraDataWrite(logger);
break;
default:
......
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