Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
7290d1b5
由
张雷
编写于
2024-10-31 17:25:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
积木报表权限修改
1 个父辈
4ea7e99a
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
81 行增加
和
9 行删除
sk-module-system/src/main/java/com/skua/modules/system/controller/SysDepartController.java
sk-module-system/src/main/java/com/skua/modules/system/mapper/SysDepartMapper.java
sk-module-system/src/main/java/com/skua/modules/system/mapper/xml/SysDepartMapper.xml
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDepartService.java
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDepartServiceImpl.java
sk-module-system/src/main/java/com/skua/modules/system/vo/DepartTree.java
sk-module-system/src/main/java/com/skua/modules/system/controller/SysDepartController.java
查看文件 @
7290d1b
...
...
@@ -733,7 +733,7 @@ public class SysDepartController {
@ApiOperation
(
"积木报表机构树"
)
@GetMapping
(
value
=
"/jimu/tree"
)
public
List
<
DepartTree
>
jimuDepartTree
(
DepartTree
departTree
)
{
List
<
DepartTree
>
list
=
sysDepartService
.
getJimuDepartTree
(
departTree
.
getPid
()
);
List
<
DepartTree
>
list
=
sysDepartService
.
getJimuDepartTree
(
departTree
);
return
list
;
}
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/mapper/SysDepartMapper.java
查看文件 @
7290d1b
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
import
com.skua.modules.system.entity.SysDepart
;
import
com.skua.modules.system.vo.DepartTree
;
import
com.skua.modules.system.vo.SysDeptUserVO
;
import
com.skua.tool.annotation.Anonymous
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
...
...
@@ -137,11 +138,24 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
String
getDepartTreeByParentDepartId
(
@Param
(
"parentDepartId"
)
String
parentDepartId
);
List
<
DepartTree
>
getJimuDepartTree
(
@Param
(
"pid"
)
String
pid
);
String
getChildDepartId
(
@Param
(
"departIds"
)
String
departIds
);
List
<
SysDeptUserVO
>
queryDeptAndUserTreeList
(
@Param
(
"departId"
)
String
departId
);
List
<
SysDeptUserVO
>
queryDeptAndSystemTreeList
(
@Param
(
"departId"
)
String
departId
);
@Anonymous
List
<
DepartTree
>
getJimuDepartTree
(
@Param
(
"pid"
)
String
pid
);
@Anonymous
List
<
DepartTree
>
getJimuDepartTreeFY
(
@Param
(
"pid"
)
String
pid
,
@Param
(
"departIds"
)
String
departIds
);
@Anonymous
List
<
DepartTree
>
getJimuDepartTreeL
(
@Param
(
"pid"
)
String
pid
,
@Param
(
"departIds"
)
String
departIds
);
@Anonymous
List
<
DepartTree
>
getJimuDepartTreeELSE
(
@Param
(
"departIds"
)
String
departIds
);
@Anonymous
SysDepart
getById
(
@Param
(
"pid"
)
String
pid
);
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/mapper/xml/SysDepartMapper.xml
查看文件 @
7290d1b
...
...
@@ -202,6 +202,40 @@
where parent_id = #{pid}
ORDER BY depart_order
</select>
<select
id=
"getJimuDepartTreeFY"
resultType=
"com.skua.modules.system.vo.DepartTree"
>
select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
where parent_id = #{pid}
and id in (select parent_id from sys_depart where id IN
<foreach
item=
"item"
index=
"index"
collection=
"departIds.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
)
ORDER BY depart_order
</select>
<select
id=
"getJimuDepartTreeL"
resultType=
"com.skua.modules.system.vo.DepartTree"
>
select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
where parent_id = #{pid}
and id IN
<foreach
item=
"item"
index=
"index"
collection=
"departIds.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
ORDER BY depart_order
</select>
<select
id=
"getJimuDepartTreeELSE"
resultType=
"com.skua.modules.system.vo.DepartTree"
>
select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
where id IN
<foreach
item=
"item"
index=
"index"
collection=
"departIds.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
ORDER BY depart_order
</select>
<select
id=
"getById"
resultType=
"com.skua.modules.system.entity.SysDepart"
>
select * from sys_depart where id = #{pid}
</select>
<select
id=
"getChildDepartId"
resultType=
"java.lang.String"
>
SELECT
GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/ISysDepartService.java
查看文件 @
7290d1b
...
...
@@ -175,7 +175,7 @@ public interface ISysDepartService extends IService<SysDepart>{
*/
String
getDepartTreeByParentDepartId
(
String
parentDepartId
);
List
<
DepartTree
>
getJimuDepartTree
(
String
pid
);
List
<
DepartTree
>
getJimuDepartTree
(
DepartTree
departTree
);
String
getChildDepartId
(
String
departIds
);
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysDepartServiceImpl.java
查看文件 @
7290d1b
...
...
@@ -8,9 +8,12 @@ import com.skua.core.constant.CommonConstant;
import
com.skua.core.context.BaseContextHandler
;
import
com.skua.core.service.ISequenceService
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.core.util.JwtUtil
;
import
com.skua.core.util.YouBianCodeUtil
;
import
com.skua.modules.system.entity.SysDepart
;
import
com.skua.modules.system.entity.SysUser
;
import
com.skua.modules.system.mapper.SysDepartMapper
;
import
com.skua.modules.system.mapper.SysUserMapper
;
import
com.skua.modules.system.model.DepartIdModel
;
import
com.skua.modules.system.model.SysDepartTreeModel
;
import
com.skua.modules.system.service.ISysDepartService
;
...
...
@@ -36,6 +39,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
private
SysDepartMapper
sysDepartMapper
;
@Autowired
private
ISequenceService
sequenceService
;
@Autowired
private
SysUserMapper
sysUserMapper
;
/***
* 查询子集所有的部门
...
...
@@ -464,11 +469,29 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
}
@Override
public
List
<
DepartTree
>
getJimuDepartTree
(
String
pid
)
{
if
(
ConvertUtils
.
isEmpty
(
pid
)){
pid
=
""
;
public
List
<
DepartTree
>
getJimuDepartTree
(
DepartTree
departTree
)
{
List
<
DepartTree
>
list
=
new
ArrayList
<>();
String
pid
=
""
;
String
departIds
=
""
;
if
(
ConvertUtils
.
isNotEmpty
(
departTree
.
getPid
())){
if
(
ConvertUtils
.
isNotEmpty
(
departTree
.
getToken
())){
SysUser
user
=
sysUserMapper
.
getUserByName
(
JwtUtil
.
getUsername
(
departTree
.
getToken
()));
if
(
user
!=
null
){
departIds
=
sysUserMapper
.
queryDepartIdsByUserId
(
user
.
getId
());
}
}
pid
=
departTree
.
getPid
();
SysDepart
depart
=
sysDepartMapper
.
getById
(
pid
);
if
(
"-1"
.
equals
(
depart
.
getDepartType
())){
list
=
sysDepartMapper
.
getJimuDepartTreeFY
(
pid
,
departIds
);
}
else
if
(
"0"
.
equals
(
depart
.
getDepartType
())){
list
=
sysDepartMapper
.
getJimuDepartTreeL
(
pid
,
departIds
);
}
else
{
list
=
new
ArrayList
<>();
}
}
else
{
list
=
sysDepartMapper
.
getJimuDepartTree
(
pid
);
}
List
<
DepartTree
>
list
=
sysDepartMapper
.
getJimuDepartTree
(
pid
);
return
list
;
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/vo/DepartTree.java
查看文件 @
7290d1b
...
...
@@ -13,6 +13,7 @@ public class DepartTree{
private
String
value
;
//实际查询用到的值
/**下拉树显示的文本值*/
private
String
title
;
//下拉树显示的文本值
/**TOKEN*/
private
String
token
;
//TOKEN
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论