List roles = Lists.newArrayList(); Boolean existAppraise = activityAppraiseeService.existByEmpCode(empCode); if (BooleanUtils.isTrue(existAppraise)) { roles.add(UserTypeEnum.APPRAISEE.getValue()); } Boolean existExaminer = activityExaminerService.existByEmpCode(empCode); if (BooleanUtils.isTrue(existExaminer)) { roles.add(UserTypeEnum.EXAMINER.getValue()); } return roles;

代码优化final ListInteger roles = ListsneWArrayList;final Boolean existAppraise = activityAppraiseeServiceexistByEmpCodeempCodeif BooleanUtisisTrueexistAppraise roles addUserTypeEnumAPPRAISEE getValuefina

原文地址: https://www.cveoy.top/t/topic/hBwy 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录