Commit 3e0a9c61 by lcx

Merge tag '二次绩效工作量类型数据修复' into develop

parents 293739f3 8f8df1bd
......@@ -276,11 +276,11 @@ public ApiResponse SingleAwards([FromBody] WorkloadRequest request)
/// 二次绩效工作量类型列表
/// </summary>
/// <returns></returns>
[Route("api/second/worktype/list")]
[Route("api/second/worktype/list/{secondId}")]
[HttpPost]
public ApiResponse WorkTypeList([FromBody] WorkloadRequest request)
public ApiResponse WorkTypeList([FromBody] WorkloadRequest request, int secondId)
{
var result = secondAllotService.WorkTypeList(request, claimService.GetUserId());
var result = secondAllotService.WorkTypeList(request, secondId);
return new ApiResponse(ResponseType.OK, result);
}
......@@ -288,16 +288,16 @@ public ApiResponse WorkTypeList([FromBody] WorkloadRequest request)
/// 保存二次绩效工作量类型
/// </summary>
/// <returns></returns>
[Route("api/second/worktype/save")]
[Route("api/second/worktype/save/{secondId}")]
[HttpPost]
public ApiResponse SingleSave([FromBody] ag_workload_type request)
public ApiResponse SingleSave([FromBody] ag_workload_type request, int secondId)
{
if (request.HospitalId == 0)
return new ApiResponse(ResponseType.ParameterError, "医院信息无效");
if (string.IsNullOrEmpty(request.TypeName))
return new ApiResponse(ResponseType.ParameterError, "填写参数无效");
var result = secondAllotService.SaveWorkType(request, claimService.GetUserId());
var result = secondAllotService.SaveWorkType(request, secondId);
return new ApiResponse(ResponseType.OK, result);
}
......
......@@ -1034,10 +1034,12 @@ public void RefreshTemp(UseTempRequest request)
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public List<TitleValue<int>> WorkTypeList(WorkloadRequest request, int userId)
public List<TitleValue<int>> WorkTypeList(WorkloadRequest request, int secondId)
{
var (unit, dept) = GetDeptAndUnit(userId);
var worktypes = agworkloadtypeRepository.GetEntities(t => request.HospitalId.Value == t.HospitalId && t.Department == dept && t.UnitType == unit);
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) throw new PerformanceException("参数错误");
var worktypes = agworkloadtypeRepository.GetEntities(t => request.HospitalId.Value == t.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType);
if (worktypes != null && worktypes.Any())
{
return worktypes.Select(t => new TitleValue<int>
......@@ -1054,10 +1056,13 @@ public List<TitleValue<int>> WorkTypeList(WorkloadRequest request, int userId)
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public ag_workload_type SaveWorkType(ag_workload_type request, int userId)
public ag_workload_type SaveWorkType(ag_workload_type request, int secondId)
{
var (unit, dept) = GetDeptAndUnit(userId);
var entity = agworkloadtypeRepository.GetEntity(t => request.HospitalId == t.HospitalId && t.Department == dept && t.UnitType == unit && t.TypeName == request.TypeName);
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) throw new PerformanceException("参数错误");
var entity = agworkloadtypeRepository.GetEntity(t => request.HospitalId == t.HospitalId && t.Department == second.Department
&& t.UnitType == second.UnitType && t.TypeName == request.TypeName);
if (entity == null)
{
if (request.Id > 0)
......@@ -1074,8 +1079,8 @@ public ag_workload_type SaveWorkType(ag_workload_type request, int userId)
{
HospitalId = request.HospitalId,
TypeName = request.TypeName,
Department = dept,
UnitType = unit,
Department = second.Department,
UnitType = second.UnitType,
};
agworkloadtypeRepository.Add(entity);
}
......@@ -1438,23 +1443,25 @@ public List<ag_workload> GetSingleList(WorkloadRequest request)
&& t.UnitType == request.UnitType && t.ItemId.StartsWith(AgWorkloadType.SingleAwards.ToString()));
}
public (string, string) GetDeptAndUnit(int userId)
{
var user = userRepository.GetEntity(t => t.ID == userId);
var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID);
//public (string, string) GetDeptAndUnit(int userId)
//{
// var user = userRepository.GetEntity(t => t.ID == userId);
// var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
// var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID);
if (role.Type == application.DirectorRole)
return (UnitType.医生组.ToString(), user.Department);
else if (role.Type == application.NurseRole)
return (UnitType.护理组.ToString(), user.Department);
if (role.Type == application.SpecialRole)
return (UnitType.特殊核算组.ToString(), user.Department);
if (role.Type == application.OfficeRole)
return (UnitType.行政后勤.ToString(), user.Department);
else
return ("", user.Department);
}
// if (role.Type == application.DirectorRole)
// {
// return (UnitType.医生组.ToString(), user.Department);
// }
// else if (role.Type == application.NurseRole)
// return (UnitType.护理组.ToString(), user.Department);
// if (role.Type == application.SpecialRole)
// return (UnitType.特殊核算组.ToString(), user.Department);
// if (role.Type == application.OfficeRole)
// return (UnitType.行政后勤.ToString(), user.Department);
// else
// return ("", user.Department);
//}
#endregion 工作量绩效配置
......@@ -2194,7 +2201,7 @@ public List<DeptDataDetails> DeptComputeDetailList(int userId, int allotId, out
if (computes == null || !computes.Any()) return new List<DeptDataDetails>();
foreach (var item in computes)
{
if (item.AccountType==AccountUnitType.行政中层.ToString())
if (item.AccountType == AccountUnitType.行政中层.ToString())
deptDatas.Add(computeService.GetAdministration(item.ID));
else
deptDatas.Add(computeService.GetDoctorDetail(item.ID));
......
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