Commit f0358673 by 李承祥

同一家医院匹配核算单元

parent b86bc909
...@@ -18,11 +18,11 @@ public PerforImdataRepository(PerformanceDbContext context) : base(context) ...@@ -18,11 +18,11 @@ public PerforImdataRepository(PerformanceDbContext context) : base(context)
{ {
} }
public IEnumerable<im_data> GetAccountingUnit(List<int> sheetList, List<string> deptList) public IEnumerable<im_data> GetAccountingUnit(List<int> sheetList, List<string> deptList, List<int> allotList)
{ {
string sql = "select distinct accountingUnit,department,unittype from im_data " + string sql = "select distinct accountingUnit,department,unittype from im_data " +
"where sheetid in @sheetList and department in @deptList"; "where sheetid in @sheetList and department in @deptList and allotid in @allotList";
return DapperQuery(sql, new { sheetList, deptList }, 1000 * 60 * 5); return DapperQuery(sql, new { sheetList, deptList, allotList }, 1000 * 60 * 5);
} }
} }
} }
...@@ -338,7 +338,8 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee ...@@ -338,7 +338,8 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
//用于查询核算单元 //用于查询核算单元
var deptList = dataList.Where(t => t.ColumnName == "科室名称").Select(t => t.Value.ToString()).Distinct().ToList(); var deptList = dataList.Where(t => t.ColumnName == "科室名称").Select(t => t.Value.ToString()).Distinct().ToList();
var sheetIdList = perforPersheetRepository.GetEntities(t => t.SheetType == (int)sheet.SheetType).Select(t => t.ID).ToList(); var sheetIdList = perforPersheetRepository.GetEntities(t => t.SheetType == (int)sheet.SheetType).Select(t => t.ID).ToList();
var imdata = perforImdataRepository.GetAccountingUnit(sheetIdList, deptList); var allotIdList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId).Select(t => t.ID).ToList();
var imdata = perforImdataRepository.GetAccountingUnit(sheetIdList, deptList, allotIdList);
//创建数据行 //创建数据行
foreach (var pointRow in dataList.Select(t => t.RowNumber).Distinct().OrderBy(t => t)) foreach (var pointRow in dataList.Select(t => t.RowNumber).Distinct().OrderBy(t => t))
......
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