Commit 464215c5 by lcx

角色添加type,替换roleId; 二次绩效替换模板,修改usetempid

parent 58138c57
......@@ -111,7 +111,7 @@ public ApiResponse SelfInfo()
user.Hospital = _hospitalService.GetUserHopital(user.UserID);
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
user.IsAgainAdmin = user.Role != null ? roleArray.Contains(user.Role.First().RoleID) : false;
user.IsAgainAdmin = user.Role != null ? roleArray.Contains(user.Role.First().Type ?? 0) : false;
return new ApiResponse(ResponseType.OK, user);
}
......@@ -181,7 +181,7 @@ public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"),
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
var roles = _roleService.GetUserRole(userId);
var isAgainAdmin = roles != null ? roleArray.Contains(roles.First().RoleID) : false;
var isAgainAdmin = roles != null ? roleArray.Contains(roles.First().Type ?? 0) : false;
var user = _userService.Update(request, isAgainAdmin);
user.Role = request.Role;
......
......@@ -132,12 +132,12 @@ public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), F
var again = againAllotService.GetAgainallot(request.AgainAllotID);
if (again == null)
return new ApiResponse(ResponseType.Fail, "当前二次绩效ID无效");
if (roles.First().RoleID == application.DirectorRole)
if (roles.First().Type == application.DirectorRole)
{
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, department, 1);
return new ApiResponse(ResponseType.OK, detail);
}
else if (roles.First().RoleID == application.NurseRole)
else if (roles.First().Type == application.NurseRole)
{
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, department, 2);
return new ApiResponse(ResponseType.OK, detail);
......
......@@ -2313,6 +2313,16 @@
菜单状态 1 启用 2禁用
</summary>
</member>
<member name="P:Performance.DtoModels.RoleResponse.Type">
<summary>
角色类型
</summary>
</member>
<member name="P:Performance.DtoModels.RoleResponse.IndexUrl">
<summary>
首页地址
</summary>
</member>
<member name="P:Performance.DtoModels.SecondListResponse.IsArchive">
<summary> 是否归档 </summary>
</member>
......
......@@ -683,6 +683,11 @@
绩效ID
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.UseTempId">
<summary>
使用模板
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.UnitType">
<summary>
科室类型
......@@ -1393,6 +1398,11 @@
科室
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.IncludeAvgCalculate">
<summary>
是否带入平均计算 是 否
</summary>
</member>
<member name="P:Performance.EntityModels.im_accountbasic.PermanentStaff">
<summary>
定科人数
......@@ -2518,6 +2528,11 @@
科室
</summary>
</member>
<member name="P:Performance.EntityModels.res_account.IncludeAvgCalculate">
<summary>
是否带入平均计算 是 否
</summary>
</member>
<member name="P:Performance.EntityModels.res_account.PermanentStaff">
<summary>
定科人数
......@@ -3338,6 +3353,16 @@
角色名称
</summary>
</member>
<member name="P:Performance.EntityModels.sys_role.Type">
<summary>
角色类型
</summary>
</member>
<member name="P:Performance.EntityModels.sys_role.IndexUrl">
<summary>
首页地址
</summary>
</member>
<member name="P:Performance.EntityModels.sys_role.Remark">
<summary>
......
......@@ -22,5 +22,15 @@ public class RoleResponse
/// 菜单状态 1 启用 2禁用
/// </summary>
public int States { get; set; }
/// <summary>
/// 角色类型
/// </summary>
public Nullable<int> Type { get; set; }
/// <summary>
/// 首页地址
/// </summary>
public string IndexUrl { get; set; }
}
}
......@@ -27,6 +27,16 @@ public class sys_role
public string RoleName { get; set; }
/// <summary>
/// 角色类型
/// </summary>
public Nullable<int> Type { get; set; }
/// <summary>
/// 首页地址
/// </summary>
public string IndexUrl { get; set; }
/// <summary>
///
/// </summary>
public string Remark { get; set; }
......
......@@ -96,9 +96,9 @@ public bool Generate(AgainAllotRequest request, int userId, string department)
var role = roles.FirstOrDefault();
if (role != null)
{
if (application.NurseRole == role.ID)
if (application.NurseRole == role.Type)
basicnumber = perforResaccountRepository.GetEntity(t => t.UnitType == (int)UnitType.护理组 && t.AllotID == againAllot.AllotID && t.AccountingUnit == department)?.RealGiveFee;
else if (application.DirectorRole == role.ID)
else if (application.DirectorRole == role.Type)
basicnumber = perforResaccountRepository.GetEntity(t => t.UnitType != (int)UnitType.护理组 && t.AllotID == againAllot.AllotID && t.AccountingUnit == department)?.RealGiveFee;
}
}
......
......@@ -30,6 +30,7 @@ public class SecondAllotService : IAutoInjection
private readonly PerforAgcomputeRepository perforAgcomputeRepository;
private readonly PerforCofagainRepository perforCofagainRepository;
private readonly PerforAgothersourceRepository perforAgothersourceRepository;
private readonly PerforRoleRepository roleRepository;
public SecondAllotService(IOptions<Application> application,
PerforUserRepository perforUserRepository,
......@@ -45,7 +46,8 @@ public class SecondAllotService : IAutoInjection
PerforAgusetempRepository perforAgusetempRepository,
PerforAgcomputeRepository perforAgcomputeRepository,
PerforCofagainRepository perforCofagainRepository,
PerforAgothersourceRepository perforAgothersourceRepository)
PerforAgothersourceRepository perforAgothersourceRepository,
PerforRoleRepository roleRepository)
{
this.application = application.Value;
this.perforUserRepository = perforUserRepository;
......@@ -62,6 +64,7 @@ public class SecondAllotService : IAutoInjection
this.perforAgcomputeRepository = perforAgcomputeRepository;
this.perforCofagainRepository = perforCofagainRepository;
this.perforAgothersourceRepository = perforAgothersourceRepository;
this.roleRepository = roleRepository;
}
#region 二次绩效列表与数据保存
......@@ -75,7 +78,8 @@ public List<SecondListResponse> GetSecondList(int userId)
var user = perforUserRepository.GetEntity(t => t.ID == userId);
if (user == null)
throw new NotImplementedException("人员ID无效");
var role = userroleRepository.GetEntity(t => t.UserID == userId);
var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID);
var hospital = perforUserhospitalRepository.GetEntity(t => t.UserID == userId);
if (hospital == null)
throw new NotImplementedException("人员未选择医院");
......@@ -98,9 +102,9 @@ public List<SecondListResponse> GetSecondList(int userId)
if (allot == null) continue;
res_account account = null;
if (role.RoleID == application.DirectorRole)
if (role.Type == application.DirectorRole)
account = accountList.FirstOrDefault(t => t.AllotID == item && (t.UnitType == (int)UnitType.医生组 || t.UnitType == (int)UnitType.医技组));
else if (role.RoleID == application.NurseRole)
else if (role.Type == application.NurseRole)
account = accountList.FirstOrDefault(t => t.AllotID == item && t.UnitType == (int)UnitType.护理组);
if (account == null) continue;
......@@ -555,14 +559,14 @@ public bool UseTemp(UseTempRequest request)
var update_second_usetemps = new List<ag_secondallot>();
foreach (var second in secondList)
{
foreach (var head in headItems)
if (second.IsArchive == 0 && new List<int> { 1, 4 }.Contains(second.Status ?? 1))
{
if (second.IsArchive == 0 && new List<int> { 1, 4 }.Contains(second.Status ?? 1))
{
var update_second_usetemp = seconds.FirstOrDefault(t => t.Id == second.Id);
update_second_usetemp.UseTempId = request.TempId;
update_second_usetemps.Add(update_second_usetemp);
var update_second_usetemp = seconds.FirstOrDefault(t => t.Id == second.Id);
update_second_usetemp.UseTempId = request.TempId;
update_second_usetemps.Add(update_second_usetemp);
foreach (var head in headItems)
{
var exist = fixatList?.Where(t => t.ItemName == head.FiledName && t.Type == head.Type && t.SecondId == second.Id);
if (exist != null && exist.Count() > 0)
list.AddRange(exist);
......
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