Просмотр исходного кода

fix(hrmp): 修复权限检查中的组织视图类型参数

- 将 OrgViewType.HR_OD 替换为字符串 "21" 作为权限检查参数
- 移除了未使用的 OrgViewType 导入
- 统一了多个位置的权限检查参数格式
- 确保组织权限验证功能正常工作
jtd 1 неделя назад
Родитель
Сommit
9fb258502d

+ 2 - 2
code/hrmp/nckd-jxccl-hrmp/src/main/java/nckd/jxccl/hrmp/hbpm/business/hr/service/impl/PositionBillBeforeBindDataService.java

@@ -63,7 +63,7 @@ public class PositionBillBeforeBindDataService extends PositionBillBaseService {
             if (businessUnit != null) {
                 getModel().setValue(PositionBillConstant.ORG_KEY, businessUnit);
             } else if (!Boolean.TRUE.toString().equals(getView().getFormShowParameter().getCustomParam(PositionBillConstant.CP_ISFROMBILLCLICK))) {
-                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), OrgViewType.HR_OD, PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
+                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), "21", PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
                 List<Long> hasPermOrgs = hrPermOrg.getHasPermOrgs();
                 if (!Objects.isNull(hasPermOrgs) && hasPermOrgs.size() != 0) {
                     if (hasPermOrgs.contains(RequestContext.get().getOrgId())) {
@@ -78,7 +78,7 @@ public class PositionBillBeforeBindDataService extends PositionBillBaseService {
             getView().cacheFormShowParameter();
         } else if (Boolean.TRUE.toString().equals(getView().getPageCache().get(PositionBillConstant.PC_ISFROMIMPORT)) || getView().getParentView() != null && (PositionBillConstant.NCKD_POSTMGR_APPHOME_ENTITY.equals(getView().getParentView().getEntityId()) || getView().getParentView().getEntityId().startsWith("wf_"))) {
             if (getView().getParentView() != null && PositionBillConstant.NCKD_POSTMGR_APPHOME_ENTITY.equals(getView().getParentView().getEntityId()) && getView().getPageCache().get(PositionBillConstant.PC_ISFROMHOMEPAGE) == null) {
-                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), OrgViewType.HR_OD, PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
+                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), "21", PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
                 List<Long> hasPermOrgs = hrPermOrg.getHasPermOrgs();
                 if (!Objects.isNull(hasPermOrgs) && hasPermOrgs.size() != 0) {
                     if (hasPermOrgs.contains(RequestContext.get().getOrgId())) {

+ 1 - 2
code/hrmp/nckd-jxccl-hrmp/src/main/java/nckd/jxccl/hrmp/hbpm/plugin/form/hr/PositionBillFormPlugin.java

@@ -60,7 +60,6 @@ import kd.bos.permission.api.HasPermOrgResult;
 import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
 import kd.bos.servicehelper.coderule.CodeRuleServiceHelper;
 import kd.bos.servicehelper.model.PermissionStatus;
-import kd.bos.servicehelper.org.OrgViewType;
 import kd.bos.servicehelper.permission.PermissionServiceHelper;
 import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
 import kd.hr.hbp.common.model.AuthorizedOrgResult;
@@ -106,7 +105,7 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
         DynamicObject org = getModel().getDataEntity().getDynamicObject(PositionBillConstant.ORG_KEY);
         if (org == null) {
             // 获取是否有查询权限
-            HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), OrgViewType.HR_OD, PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, true);
+            HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), "21", PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, true);
             List<Long> hasPermOrgs = hrPermOrg.getHasPermOrgs();
             if (!Objects.isNull(hasPermOrgs) && hasPermOrgs.size() != 0) {
                 if (hasPermOrgs.contains(RequestContext.get().getOrgId())) {

+ 1 - 1
code/hrmp/nckd-jxccl-hrmp/src/main/java/nckd/jxccl/hrmp/hbpm/plugin/form/hr/PositionBillListPlugin.java

@@ -38,7 +38,7 @@ public class PositionBillListPlugin extends AbstractListPlugin {
                 getView().getPageCache().remove(PositionBillConstant.PC_ISFROMBILLCLICK);
                 e.getParameter().setCustomParam(PositionBillConstant.CP_ISFROMBILLCLICK, Boolean.TRUE.toString());
             } else {
-                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), OrgViewType.HR_OD, PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
+                HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), "21", PositionBillConstant.HOMS_APP, PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, false);
                 List<Long> hasPermOrgs = hrPermOrg.getHasPermOrgs();
                 if (!Objects.isNull(hasPermOrgs) && hasPermOrgs.size() != 0) {
                     if (hasPermOrgs.contains(RequestContext.get().getOrgId())) {