Commit bebc5339 by 钟博

Merge branch 'feature/划拨' into release/v20210709功能分支合并

# Conflicts:
#	performance/Performance.EntityModels/Context/PerformanceDbContext.cs
parents 3325e3a8 fa2bbcba
......@@ -60,7 +60,7 @@ public class Common
{
public string Source { get; set; }
public string Category { get; set; }
public decimal Ratio { get; set; }
public decimal? Ratio { get; set; }
}
public class Option : cost_transfer_item
......
......@@ -28,6 +28,8 @@ public class CostTransferService : IAutoInjection
private readonly PerforPerdeptdicRepository perdeptdicRepository;
private readonly PerforPerallotRepository perallotRepository;
private readonly PerforImdataRepository imdataRepository;
private readonly PerforCofdrugtypefactorRepository perforCofdrugtypefactor;
private readonly PerforExmoduleRepository perforExmodule;
public CostTransferService(
ILogger<CostTransferService> logger,
......@@ -39,7 +41,9 @@ public class CostTransferService : IAutoInjection
PerforCofaccountingRepository cofaccountingRepository,
PerforPerdeptdicRepository perdeptdicRepository,
PerforPerallotRepository perallotRepository,
PerforImdataRepository imdataRepository
PerforImdataRepository imdataRepository,
PerforCofdrugtypefactorRepository perforCofdrugtypefactor,
PerforExmoduleRepository perforExmodule
)
{
this.logger = logger;
......@@ -52,6 +56,8 @@ PerforImdataRepository imdataRepository
this.perdeptdicRepository = perdeptdicRepository;
this.perallotRepository = perallotRepository;
this.imdataRepository = imdataRepository;
this.perforCofdrugtypefactor = perforCofdrugtypefactor;
this.perforExmodule = perforExmodule;
}
/// <summary>
......@@ -174,6 +180,21 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
common.unitType = deptDetail.UnitType ?? "";
var drugFactor = perforCofdrugtypefactor.GetEntities(t => t.HospitalId == hospitalId && t.AllotID == allotId);
if (drugFactor == null || !drugFactor.Any()) return common;
var exModule = perforExmodule.GetEntities(t => drugFactor.Select(c => c.ExModuleId).Contains(t.Id) && t.SheetType == (int)SheetType.Income);
common.Data = drugFactor.Select(t => new Common
{
Source = Regex.Replace(exModule.Find(w => w.Id == t.ExModuleId).ModuleName, @"\d.", ""),
Category = t.Charge,
Ratio = (detail.UnitType == "医生组" ? t.YSZ : detail.UnitType == "医技组" ? t.YJZ : t.HLZ) ?? 0
}).ToList();
#region 注释
/*
var sheets = persheetRepository.GetEntities(t => t.AllotID == allotId && t.SheetType == (int)SheetType.Income);
if (sheets != null && sheets.Any())
{
......@@ -201,8 +222,9 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
}).ToList();
}
common.Data = commons;
}
} */
#endregion
return common;
}
......
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