From 45dedb270a0bfada6128cbf5cf61748cf7af0bea Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Wed, 7 Jan 2026 14:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/system/api/domain/SysDept.java | 5 +++++ .../java/com/bonus/gateway/filter/AuthFilter.java | 2 +- .../bonus/file/controller/SysFileController.java | 2 +- .../com/bonus/system/domain/vo/OrgDeptTreeVo.java | 15 +++++++++++++++ .../service/impl/SysNewDeptServiceImpl.java | 11 ++++++++++- .../resources/mapper/system/SysDeptMapper.xml | 5 +++++ 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/bonus-api/bonus-api-system/src/main/java/com/bonus/system/api/domain/SysDept.java b/bonus-api/bonus-api-system/src/main/java/com/bonus/system/api/domain/SysDept.java index edca62c..9c1d003 100644 --- a/bonus-api/bonus-api-system/src/main/java/com/bonus/system/api/domain/SysDept.java +++ b/bonus-api/bonus-api-system/src/main/java/com/bonus/system/api/domain/SysDept.java @@ -129,6 +129,11 @@ public class SysDept extends BaseEntity { private SysUser sysUser; + /** + * 是否首页显示 + */ + private Boolean enableIndexShow; + /** * 所属公司ID */ diff --git a/bonus-gateway/src/main/java/com/bonus/gateway/filter/AuthFilter.java b/bonus-gateway/src/main/java/com/bonus/gateway/filter/AuthFilter.java index 2820413..53439c6 100644 --- a/bonus-gateway/src/main/java/com/bonus/gateway/filter/AuthFilter.java +++ b/bonus-gateway/src/main/java/com/bonus/gateway/filter/AuthFilter.java @@ -128,7 +128,7 @@ public class AuthFilter implements GlobalFilter, Ordered { private String getToken(ServerHttpRequest request) { String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION); // 如果前端设置了令牌前缀,则裁剪掉前缀 - if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX)) { + if (token != null && StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX)) { token = token.replaceFirst(TokenConstants.PREFIX, StringUtils.EMPTY); } return token; diff --git a/bonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java b/bonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java index 2edfc70..a1eae87 100644 --- a/bonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java +++ b/bonus-modules/bonus-file/src/main/java/com/bonus/file/controller/SysFileController.java @@ -83,7 +83,7 @@ public class SysFileController { // 处理可能包含的data URI前缀(如"data:image/png;base64,") String base64Data; - if (entity.getBase64File().startsWith("data:")) { + if (entity.getBase64File().startsWith("data:") ) { // 提取真正的base64内容 String[] parts = entity.getBase64File().split(","); if (parts.length < 2) { diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/domain/vo/OrgDeptTreeVo.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/domain/vo/OrgDeptTreeVo.java index 12e5f8c..ff5fb27 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/domain/vo/OrgDeptTreeVo.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/domain/vo/OrgDeptTreeVo.java @@ -28,6 +28,21 @@ public class OrgDeptTreeVo { /** 级别:一级机构、二级机构、三级机构 */ private String level; + /** + * 负责人 + */ + private String leader; + + /** + * 联系电话 + */ + private String phone; + + /** + * 是否首页显示 + */ + private Boolean isShow; + /** 主管理员 */ private String mainAdmin; diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysNewDeptServiceImpl.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysNewDeptServiceImpl.java index 514cdfa..cd95c33 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysNewDeptServiceImpl.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/service/impl/SysNewDeptServiceImpl.java @@ -158,6 +158,9 @@ public class SysNewDeptServiceImpl implements ISysNewDeptService { public int insertOrg(OrgDeptTreeVo org) { SysDept sysDept = new SysDept(); sysDept.setDeptName(org.getOrgName() != null ? org.getOrgName() : org.getName()); + sysDept.setLeader(org.getLeader()); + sysDept.setPhone(org.getPhone()); + sysDept.setEnableIndexShow(org.getIsShow() != null ? org.getIsShow() : false); sysDept.setStatus("0"); sysDept.setDelFlag("0"); sysDept.setLeader(org.getMainAdmin()); @@ -193,7 +196,9 @@ public class SysNewDeptServiceImpl implements ISysNewDeptService { } sysDept.setDeptName(org.getOrgName() != null ? org.getOrgName() : org.getName()); - sysDept.setLeader(org.getMainAdmin()); + sysDept.setLeader(org.getLeader()); + sysDept.setPhone(org.getPhone()); + sysDept.setEnableIndexShow(org.getIsShow() != null ? org.getIsShow() : false); return sysDeptMapper.updateDept(sysDept); } @@ -327,6 +332,10 @@ public class SysNewDeptServiceImpl implements ISysNewDeptService { // 设置级别 vo.setLevel(getLevelString(dept.getDeptLevel())); + vo.setLeader(dept.getLeader()); + vo.setPhone(dept.getPhone()); + vo.setIsShow(dept.getEnableIndexShow()); + // 递归构建子节点 List children = buildOrgTree(deptList, usersByDept, dept.getDeptId(), query); if (children != null && !children.isEmpty()) { diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/system/SysDeptMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/system/SysDeptMapper.xml index 1090415..ef8814b 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.leader, d.phone, d.status, + d.is_show, d.del_flag, d.create_by, d.create_time, @@ -209,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" init_password, menu_template_id, status, + is_show, create_by, dept_level, create_time @@ -231,6 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{initPassword}, #{menuTemplateId}, #{status}, + #{enableIndexShow}, #{createBy}, #{deptLevel}, sysdate() @@ -258,6 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" init_password = #{initPassword}, menu_template_id = #{menuTemplateId}, status = #{status}, + is_show = #{enableIndexShow}, update_by = #{updateBy}, del_flag = #{delFlag}, update_time = sysdate()