Commit 48f2afc5 by lcx

Merge branch 'feature/新二次分配' of http://192.168.18.110:8880/zry/performance into feature/新二次分配

parents f941ce08 34e0a0f8
......@@ -842,6 +842,9 @@
<member name="F:Performance.DtoModels.SheetType.Assess">
<summary> 考核 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.OnlyExtract">
<summary> 抽取数据,不写入 </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType">
<summary>
核算单元类型
......
......@@ -261,17 +261,20 @@ public IEnumerable<view_second_workload_result> GetSecondWorkload(int allotid, s
/// <param name="unittype"></param>
/// <param name="accountingunit"></param>
/// <returns></returns>
public IEnumerable<string> GetSecondWorkloadMaps(int allotid, string unittype, string accountingunit)
public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
{
using (var connection = context.Database.GetDbConnection())
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string query = $@"SELECT DISTINCT Category FROM view_second_workload_his his
INNER JOIN per_dept_dic dic ON his.HospitalId = dic.HospitalId and his.UnitType = dic.UnitType and his.Department = dic.HISDeptName
WHERE AllotId = @allotid AND dic.UnitType = @unittype AND dic.AccountingUnit = @accountingunit";
return connection.Query<string>(query, new { allotid, unittype, accountingunit }, commandTimeout: 60 * 60);
string query = $@"SELECT DISTINCT Category FROM (
SELECT IF(Source = 102,EName,ItemName) Category FROM ex_type t1
LEFT JOIN ex_item t2 ON t1.Id = t2.TypeId
WHERE Source IN (102,7) AND HospitalId = @hospitalId
)TAB
WHERE IFNULL(Category,'')<>''";
return connection.Query<string>(query, new { hospitalId }, commandTimeout: 60 * 60);
}
catch (Exception ex)
{
......
......@@ -1063,7 +1063,10 @@ public List<string> WorkloadMap(int secondId)
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) throw new PerformanceException("参数错误");
var worktypes = perallotRepository.GetSecondWorkloadMaps(second.AllotId.Value, second.UnitType, second.Department);
var allot = perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null) throw new PerformanceException("参数错误");
var worktypes = perallotRepository.GetSecondWorkloadMaps(allot.HospitalId);
return (worktypes != null && worktypes.Any()) ? worktypes.ToList() : new List<string>();
}
......
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