| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入dept") |
| | | public R<DeptVO> detail(Dept dept) { |
| | | Dept detail = deptService.getOne(Condition.getQueryWrapper(dept)); |
| | | return R.data(DeptWrapper.build().entityVO(detail)); |
| | | DeptVO detail = deptService.getDetailWithAreaName(dept); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/tree") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> tree(String tenantId, BladeUser bladeUser) { |
| | | List<DeptVO> tree = deptService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId())); |
| | | public R<List<DeptVO>> tree(String tenantId, @RequestParam(value = "sysType", required = false) String sysType, BladeUser bladeUser) { |
| | | List<DeptVO> tree = deptService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), sysType); |
| | | return R.data(tree); |
| | | } |
| | | |
| | |
| | | if (deptService.submit(deptEntity)) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getDeptId, dept.getId())); |
| | | // 根据部门ID查询用户列表 |
| | | List<User> userList = userMapper.selectUsersByDeptId(String.valueOf(dept.getId())); |
| | | if (!userList.isEmpty()) { |
| | | List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList()); |
| | | userMapper.updateUserAreaCode(dept.getAreaCode(), userIds); |
| | |
| | | String fileName = URLEncoder.encode("机构模板", StandardCharsets.UTF_8.name()); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | |
| | | // 准备空数据列表 |
| | | // 准备示例数据列表 |
| | | List<DeptImportExcel> list = new ArrayList<>(); |
| | | // 创建示例数据对象 |
| | | DeptImportExcel example = new DeptImportExcel(); |
| | | // 设置示例数据 |
| | | example.setDeptName("示例机构"); |
| | | example.setAreaCode("360800000000"); |
| | | example.setRemark("这是一个示例机构"); |
| | | example.setStatus("1"); // 假设1表示启用状态 |
| | | // 将示例数据添加到列表 |
| | | list.add(example); |
| | | |
| | | // 使用EasyExcel导出,并注册RegionSheetWriteHandler |
| | | EasyExcel.write(response.getOutputStream(), DeptImportExcel.class) |