Commit d8237d45 by 钟博

绩效发放下载功能,人员字典粘贴问题,删除人员字典校验

parent 58df56db
...@@ -21,18 +21,21 @@ public class DownloadService : IAutoInjection ...@@ -21,18 +21,21 @@ public class DownloadService : IAutoInjection
private readonly ILogger<DownloadService> logger; private readonly ILogger<DownloadService> logger;
private readonly PerforPerallotRepository perallotRepository; private readonly PerforPerallotRepository perallotRepository;
private readonly PerforHospitalRepository perforHospital; private readonly PerforHospitalRepository perforHospital;
private readonly PerforCofaliasRepository perforCofalias;
private readonly ConfigService configService; private readonly ConfigService configService;
private readonly IHostingEnvironment evn; private readonly IHostingEnvironment evn;
public DownloadService(ILogger<DownloadService> logger, public DownloadService(ILogger<DownloadService> logger,
PerforPerallotRepository perallotRepository, PerforPerallotRepository perallotRepository,
PerforHospitalRepository perforHospital, PerforHospitalRepository perforHospital,
PerforCofaliasRepository perforCofalias,
ConfigService configService, ConfigService configService,
IHostingEnvironment evn) IHostingEnvironment evn)
{ {
this.logger = logger; this.logger = logger;
this.perallotRepository = perallotRepository; this.perallotRepository = perallotRepository;
this.perforHospital = perforHospital; this.perforHospital = perforHospital;
this.perforCofalias = perforCofalias;
this.configService = configService; this.configService = configService;
this.evn = evn; this.evn = evn;
} }
...@@ -54,10 +57,25 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -54,10 +57,25 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
{ {
var allot = perallotRepository.GetEntity(t => t.ID == allotId); var allot = perallotRepository.GetEntity(t => t.ID == allotId);
var hospital = perforHospital.GetEntity(t => t.ID == allot.HospitalId); var hospital = perforHospital.GetEntity(t => t.ID == allot.HospitalId);
var alias = perforCofalias.GetEntities(t => t.HospitalId == hospital.ID && t.States == 1);
var headShow = new List<string> { "银行卡号", "正式/临聘", "职务", "职称" };
var headList = AllCompute; var headList = AllCompute;
if (!isAll) if (!isAll)
{
headList = Person; headList = Person;
alias = alias?.Where(t => t.Route == "/result/wholeHospital")?.ToList();
if (alias != null)
headShow = headShow.Except(alias.Select(t => t.OriginalName)).ToList();
}
else
{
alias = alias?.Where(t => t.Route == "/result/compute")?.ToList();
if (alias != null)
headShow = headShow.Except(alias.Select(t => t.OriginalName)).ToList();
}
var dpath = Path.Combine(evn.ContentRootPath, "Files", "PerformanceRelease", $"{allot.HospitalId}"); var dpath = Path.Combine(evn.ContentRootPath, "Files", "PerformanceRelease", $"{allot.HospitalId}");
FileHelper.CreateDirectory(dpath); FileHelper.CreateDirectory(dpath);
...@@ -84,9 +102,12 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -84,9 +102,12 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
row1.GetCell(0).CellStyle = style; row1.GetCell(0).CellStyle = style;
int cellIndex = 1; int cellIndex = 1;
foreach (var item in headList.Select(t => t.Item2)) foreach (var item in headList)
{ {
row1.CreateCell(cellIndex).SetCellValue(item); if (headShow.Contains(item.Item2))
continue;
row1.CreateCell(cellIndex).SetCellValue(item.Item2);
row1.GetCell(cellIndex).CellStyle = style; row1.GetCell(cellIndex).CellStyle = style;
sheet.SetColumnWidth(cellIndex, 14 * 256); sheet.SetColumnWidth(cellIndex, 14 * 256);
cellIndex++; cellIndex++;
...@@ -100,10 +121,13 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -100,10 +121,13 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
var serial = row.CreateCell(0); var serial = row.CreateCell(0);
serial.SetCellOValue(startIndex); serial.SetCellOValue(startIndex);
serial.CellStyle = style; serial.CellStyle = style;
foreach (var field in headList.Select(t => t.Item3)) foreach (var field in headList)
{ {
if (headShow.Contains(field.Item2))
continue;
var cell = row.CreateCell(cellIndex); var cell = row.CreateCell(cellIndex);
cell.SetCellOValue(field?.Invoke(item)); cell.SetCellOValue(field.Item3?.Invoke(item));
cell.CellStyle = style; cell.CellStyle = style;
cellIndex++; cellIndex++;
} }
...@@ -115,10 +139,13 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -115,10 +139,13 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
var totalSerial = totalRow.CreateCell(0); var totalSerial = totalRow.CreateCell(0);
totalSerial.SetCellOValue("合计"); totalSerial.SetCellOValue("合计");
totalSerial.CellStyle = style; totalSerial.CellStyle = style;
foreach (var value in headList.Select(t => t.Item4)) foreach (var value in headList)
{ {
if (headShow.Contains(value.Item2))
continue;
var cell = totalRow.CreateCell(cellIndex); var cell = totalRow.CreateCell(cellIndex);
cell.SetCellFormula(string.Format(value, startIndex)); cell.SetCellFormula(string.Format(value.Item4, startIndex));
cell.CellStyle = style; cell.CellStyle = style;
cellIndex++; cellIndex++;
} }
...@@ -154,6 +181,10 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -154,6 +181,10 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
(nameof(ComputeResponse.ShouldGiveFee), "应发小计",t=>t.ShouldGiveFee,"SUM(O2:O{0})"), (nameof(ComputeResponse.ShouldGiveFee), "应发小计",t=>t.ShouldGiveFee,"SUM(O2:O{0})"),
(nameof(ComputeResponse.ReservedRatioFee), "预留绩效",t=>t.ReservedRatioFee,"SUM(P2:P{0})"), (nameof(ComputeResponse.ReservedRatioFee), "预留绩效",t=>t.ReservedRatioFee,"SUM(P2:P{0})"),
(nameof(ComputeResponse.RealGiveFee), "实发绩效",t=>t.RealGiveFee,"SUM(Q2:Q{0})"), (nameof(ComputeResponse.RealGiveFee), "实发绩效",t=>t.RealGiveFee,"SUM(Q2:Q{0})"),
(nameof(ComputeResponse.BankCard), "银行卡号",t=>t.BankCard,""),
(nameof(ComputeResponse.JobCategory), "正式/临聘",t=>t.JobCategory,""),
(nameof(ComputeResponse.Duty), "职务",t=>t.Duty,""),
(nameof(ComputeResponse.TitlePosition), "职称",t=>t.TitlePosition,""),
}; };
public static List<(string, string, Func<ComputeResponse, object>, string)> Person { get; } = new List<(string, string, Func<ComputeResponse, object>, string)> public static List<(string, string, Func<ComputeResponse, object>, string)> Person { get; } = new List<(string, string, Func<ComputeResponse, object>, string)>
......
...@@ -619,11 +619,11 @@ public string ImpoerAprEmployees(int allotid, string path, int userid) ...@@ -619,11 +619,11 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
entities.Add(entity); entities.Add(entity);
} }
var numbers = entities.Select(t => t.PersonnelNumber).Except(employees.Select(w => w.PersonnelNumber)); //var numbers = entities.Select(t => t.PersonnelNumber).Except(employees.Select(w => w.PersonnelNumber));
if (numbers?.Count() > 0 && numbers?.Count() <= 5) //if (numbers?.Count() > 0 && numbers?.Count() <= 5)
return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.ToArray())}"; // return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.ToArray())}";
else if (numbers?.Count() > 5) //else if (numbers?.Count() > 5)
return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.Take(5)).Replace("]", ",...]")}"; // return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.Take(5)).Replace("]", ",...]")}";
// 补充核算单元 // 补充核算单元
......
...@@ -1116,6 +1116,9 @@ public void SaveQueryRole(int hospitalId, SaveCollectData request) ...@@ -1116,6 +1116,9 @@ public void SaveQueryRole(int hospitalId, SaveCollectData request)
var dict = new Dictionary<string, string>(); var dict = new Dictionary<string, string>();
PersonPassword.ForEach(t => dict.Add(t.Item1, t.Item2)); PersonPassword.ForEach(t => dict.Add(t.Item1, t.Item2));
var hospital = perforHospitalRepository.GetEntity(t => t.ID == hospitalId); var hospital = perforHospitalRepository.GetEntity(t => t.ID == hospitalId);
if (hospital.IsOwnerQuery != 1)
return;
var dicData = CreateDataRow(request, dict); var dicData = CreateDataRow(request, dict);
var usercollor = new UserCollectData var usercollor = new UserCollectData
{ {
......
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