From c923cc93f0d7ea7594ee82e0272d906e28eb7d89 Mon Sep 17 00:00:00 2001 From: tangqian Date: Fri, 16 Jun 2023 10:53:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E6=8E=A8=E5=B9=BF=E5=91=98=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/iocoder/yudao/framework/common/pojo/PageParam.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java index 05f341eb7..76de9c3a6 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java @@ -23,7 +23,7 @@ public class PageParam implements Serializable { @Schema(description = "每页条数,最大值为 10000", required = true, example = "10") @NotNull(message = "每页条数不能为空") @Min(value = 1, message = "每页条数最小值为 1") - @Max(value = 100, message = "每页条数最大值为 10000") + @Max(value = 10000, message = "每页条数最大值为 10000") private Integer pageSize = PAGE_SIZE; } From f0d3b5a72d6d710fc2fb2cdc5995da37ab24ac4d Mon Sep 17 00:00:00 2001 From: tangqian Date: Fri, 16 Jun 2023 11:29:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E6=8E=A8=E5=B9=BF=E5=91=98=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/system/service/dept/DeptService.java | 7 +++++++ .../yudao/module/system/service/dept/DeptServiceImpl.java | 7 ++++++- .../module/system/service/tenant/TenantServiceImpl.java | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index 5fec22339..86984a668 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -118,4 +118,11 @@ public interface DeptService { void validateDeptList(Collection ids); void batchImport(MultipartFile file); + + /** + * 根据tenantId获取一级部门 + * @param tenantId + * @return + */ + DeptDO getById(Long tenantId); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 278ee0952..f384dfa28 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -147,7 +147,7 @@ public class DeptServiceImpl implements DeptService { deptDOS.forEach(x -> { x.setParentOrganizationName(x.getParentOrganizationName().replace(deptDO.getName(), reqVO.getName())); }); - deptMapper.updateBatch(deptDOS,deptDOS.size()); + deptMapper.updateBatch(deptDOS, deptDOS.size()); deptDO.setName(reqVO.getName()); deptMapper.updateById(deptDO); // 发送刷新消息 @@ -397,4 +397,9 @@ public class DeptServiceImpl implements DeptService { } } + @Override + public DeptDO getById(Long tenantId) { + return deptMapper.selectOne(Wrappers.lambdaQuery().eq(DeptDO::getTenantId, tenantId).eq(DeptDO::getParentId, 0L).last("limit 1")); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index f766cbfcf..d09341491 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -11,9 +11,11 @@ import cn.iocoder.yudao.framework.tenant.config.TenantProperties; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*; import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; @@ -168,6 +170,12 @@ public class TenantServiceImpl implements TenantService { if (ObjectUtil.notEqual(tenant.getPackageId(), updateReqVO.getPackageId())) { updateTenantRoleMenu(tenant.getId(), tenantPackage.getMenuIds()); } + // 同步修改部门信息 + DeptUpdateReqVO reqVO = new DeptUpdateReqVO(); + DeptDO dept = deptService.getDept(updateReqVO.getId()); + reqVO.setName(updateReqVO.getName()); + reqVO.setId(dept.getId()); + deptService.updateDept(reqVO); } /**