| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import com.vci.ubcs.system.entity.Dept; |
| | | import com.vci.ubcs.system.enums.DictEnum; |
| | | import com.vci.ubcs.system.service.IDeptService; |
| | |
| | | public class DeptController extends BladeController { |
| | | |
| | | private final IDeptService deptService; |
| | | private final NacosConfigCache nacosConfigCache; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | @ApiOperation(value = "列表", notes = "传入dept") |
| | | public R<List<DeptVO>> list(@ApiIgnore @RequestParam Map<String, Object> dept, BladeUser bladeUser) { |
| | | QueryWrapper<Dept> queryWrapper = Condition.getQueryWrapper(dept, Dept.class); |
| | | List<Dept> list = deptService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Dept::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | List<Dept> list = deptService.list((!bladeUser.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId())) ? queryWrapper.lambda().eq(Dept::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | return R.data(DeptWrapper.build().listNodeVO(list)); |
| | | } |
| | | |