|
|
|
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Shentun.Peis.Items; |
|
|
|
using Shentun.Peis.Models; |
|
|
|
using Shentun.Peis.OrganizationUnits; |
|
|
|
using Shentun.Peis.SysParmTypes; |
|
|
|
using Shentun.Peis.Units; |
|
|
|
using System; |
|
|
|
@ -30,17 +31,23 @@ namespace Shentun.Peis.SysParmValues |
|
|
|
private readonly IRepository<SysParm> _sysParmRepository; |
|
|
|
private readonly IRepository<IdentityUser, Guid> _userRepository; |
|
|
|
private readonly SysParmValueManager _manager; |
|
|
|
private readonly ICurrentUser _currentUser; |
|
|
|
private readonly PeisOrganizationUnitManager _peisOrganizationUnitManager; |
|
|
|
|
|
|
|
public SysParmValueAppService( |
|
|
|
IRepository<SysParmValue> repository, |
|
|
|
IRepository<SysParm> sysParmRepository, |
|
|
|
IRepository<IdentityUser, Guid> userRepository, |
|
|
|
SysParmValueManager manager) |
|
|
|
SysParmValueManager manager, |
|
|
|
ICurrentUser currentUser, |
|
|
|
PeisOrganizationUnitManager peisOrganizationUnitManager) |
|
|
|
{ |
|
|
|
this._repository = repository; |
|
|
|
this._sysParmRepository = sysParmRepository; |
|
|
|
this._userRepository = userRepository; |
|
|
|
this._manager = manager; |
|
|
|
_currentUser = currentUser; |
|
|
|
_peisOrganizationUnitManager = peisOrganizationUnitManager; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -51,7 +58,10 @@ namespace Shentun.Peis.SysParmValues |
|
|
|
[HttpPost("api/app/SysParmValue/GetSysParmValueBySysParmId")] |
|
|
|
public async Task<string> GetSysParmValueBySysParmIdAsync(SysParmValueInputDto input) |
|
|
|
{ |
|
|
|
string sysParmValue = await _manager.GetSysParmValueAsync(input.MedicalCenterId, input.SysParmId); |
|
|
|
var userId = _currentUser.Id.Value; |
|
|
|
var medicalCenterId = await _peisOrganizationUnitManager.GetPeisIdAsync(userId); |
|
|
|
|
|
|
|
string sysParmValue = await _manager.GetSysParmValueAsync(medicalCenterId != null ? medicalCenterId.Value : Guid.Empty, input.SysParmId); |
|
|
|
return sysParmValue; |
|
|
|
} |
|
|
|
|
|
|
|
|