Commit ef210c57 by ruyun.zhang

科室大屏绩效发放占比支持核算组别

parent af3f7dc9
using System.Collections.Generic; using Dapper;
using System.Linq;
using Dapper;
using GraphQL.Types; using GraphQL.Types;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository;
using Performance.Services; using Performance.Services;
using System.Collections.Generic;
using System.Linq;
namespace Performance.Api namespace Performance.Api
{ {
public class PerformanceQuery : ObjectGraphType public class PerformanceQuery : ObjectGraphType
{ {
public PerformanceQuery(GraphQLService service) public PerformanceQuery(GraphQLService service, ClaimService claimService, PerforUserRepository userRepository)
{ {
Field<ListGraphType<ReportDataType>>("info", Field<ListGraphType<ReportDataType>>("info",
resolve: context => resolve: context =>
...@@ -55,9 +56,19 @@ public PerformanceQuery(GraphQLService service) ...@@ -55,9 +56,19 @@ public PerformanceQuery(GraphQLService service)
resolve: context => resolve: context =>
{ {
int reportId = context.Arguments.ContainsKey(QueryParams.reportId) int reportId = context.Arguments.ContainsKey(QueryParams.reportId)
? ConvertHelper.To<int>(context.Arguments[QueryParams.reportId]) ? ConvertHelper.To<int>(context.Arguments[QueryParams.reportId])
: 0; : 0;
var parameters = GetDynamicParameters(context.Arguments, QueryParams.hospitalId, QueryParams.year, QueryParams.month, QueryParams.accountingUnit, QueryParams.category, QueryParams.itemName); var parameters = GetDynamicParameters(context.Arguments, QueryParams.hospitalId, QueryParams.year, QueryParams.month, QueryParams.accountingUnit, QueryParams.category, QueryParams.itemName);
var userId = claimService.GetUserId();
var userInfo = userRepository.GetUser(userId);
if (userInfo?.URole != null)
{
var unitTypes = UnitTypeUtil.GetMaps(userInfo?.URole.Type ?? 0);
if (unitTypes.Any())
parameters.Add("unittype", unitTypes);
}
return service.GetReportPerformance(reportId, parameters); return service.GetReportPerformance(reportId, parameters);
} }
); );
......
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