Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
7f4766be
由
张雷
编写于
2024-11-15 18:54:04 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
积木报表厂区接口修改
1 个父辈
c2ab605c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
39 行增加
和
7 行删除
sk-base-common/src/main/java/com/skua/modules/common/mapper/CommonSqlMapper.java
sk-base-common/src/main/java/com/skua/modules/common/mapper/xml/CommonSqlMapper.xml
sk-module-biz/src/main/java/com/skua/modules/threedimensional/controller/ThreeDController.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/SysUserMapper.java
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysUserServiceImpl.java
sk-base-common/src/main/java/com/skua/modules/common/mapper/CommonSqlMapper.java
查看文件 @
7f4766b
...
...
@@ -56,5 +56,7 @@ public interface CommonSqlMapper {
String
getChildFactorys
(
@Param
(
value
=
"departId"
)
String
departId
);
String
getChildDeparts
(
@Param
(
value
=
"departId"
)
String
departId
);
String
getChildDepartByUserId
(
@Param
(
value
=
"userId"
)
String
userId
);
}
...
...
sk-base-common/src/main/java/com/skua/modules/common/mapper/xml/CommonSqlMapper.xml
查看文件 @
7f4766b
...
...
@@ -94,6 +94,28 @@
</foreach>
))
</select>
<select
id=
"getChildDeparts"
resultType=
"java.lang.String"
>
SELECT
GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
FROM
sys_depart
WHERE
parent_id IN
<foreach
item=
"item"
index=
"index"
collection=
"departId.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
OR id IN
<foreach
item=
"item"
index=
"index"
collection=
"departId.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
<foreach
item=
"item"
index=
"index"
collection=
"departId.split(',')"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
)
</select>
<select
id=
"getChildDepartByUserId"
resultType=
"java.lang.String"
>
select CONCAT(dep_id,',',dep_ids) AS ids
from sys_user_depart
...
...
sk-module-biz/src/main/java/com/skua/modules/threedimensional/controller/ThreeDController.java
查看文件 @
7f4766b
...
...
@@ -100,17 +100,18 @@ public class ThreeDController {
return
result
;
}
@CustomExceptionAnno
(
description
=
"
三维-
厂区在线状态"
)
@AutoLog
(
value
=
"
三维-
厂区在线状态"
)
@ApiOperation
(
value
=
"
三维-厂区在线状态"
,
notes
=
"三维-
厂区在线状态"
)
@CustomExceptionAnno
(
description
=
"厂区在线状态"
)
@AutoLog
(
value
=
"厂区在线状态"
)
@ApiOperation
(
value
=
"
厂区在线状态"
,
notes
=
"
厂区在线状态"
)
@GetMapping
(
value
=
"/factoryOnLine"
)
public
Result
<
SysFactoryInfoVO
>
factoryOnLine
(
@RequestParam
(
name
=
"departId"
,
defaultValue
=
"f2df9193c8bc4e7a9cef0e4b98dd9e95"
)
String
departId
,
@RequestParam
(
name
=
"departType"
,
defaultValue
=
"1"
,
required
=
false
)
String
departType
)
{
Result
result
=
new
Result
<>();
result
.
setSuccess
(
true
);
result
.
setResult
(
new
HashMap
<>());
QueryWrapper
<
SysDepart
>
sysDepartQueryWrapper
=
new
QueryWrapper
<>();
sysDepartQueryWrapper
.
eq
(
"depart_type"
,
departType
).
eq
(
"del_flag"
,
1
);
List
<
Map
<
String
,
Object
>>
deviceList
=
sysDepartService
.
queryFactoryDevice
(
sysDepartQueryWrapper
);
JdbcTemplate
pgDb
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"pg-db"
);
int
onlineCount
=
0
;
if
(!
CollectionUtils
.
isEmpty
(
deviceList
))
{
List
<
Object
>
list
=
new
ArrayList
<>();
...
...
@@ -138,8 +139,6 @@ public class ThreeDController {
resultMaps
.
put
(
"offlineCount"
,
deviceList
.
size
()
-
onlineCount
>
0
?
deviceList
.
size
()
-
onlineCount
:
0
);
result
.
setSuccess
(
true
);
result
.
setResult
(
resultMaps
);
}
else
{
result
.
error500
(
"500"
);
}
return
result
;
...
...
sk-module-system/src/main/java/com/skua/modules/system/mapper/SysDepartMapper.java
查看文件 @
7f4766b
...
...
@@ -159,7 +159,9 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
@Anonymous
SysDepart
getById
(
@Param
(
"pid"
)
String
pid
);
@Anonymous
List
<
SysDepart
>
getChildDepartList
(
@Param
(
"departIds"
)
String
departIds
);
@Anonymous
List
<
SysDepart
>
queryDepartsByIds
(
@Param
(
"ids"
)
String
ids
);
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/mapper/SysUserMapper.java
查看文件 @
7f4766b
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.skua.modules.system.entity.SysUser
;
import
com.skua.tool.annotation.Anonymous
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -76,5 +77,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
List
<
SysUser
>
operationUserList
(
@Param
(
"departId"
)
String
departId
);
@Anonymous
String
queryDepartIdsByUserId
(
@Param
(
"userId"
)
String
userId
);
}
...
...
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysUserServiceImpl.java
查看文件 @
7f4766b
...
...
@@ -12,6 +12,7 @@ import com.skua.core.api.vo.SysUserCacheInfo;
import
com.skua.core.constant.CommonConstant
;
import
com.skua.core.context.BaseContextHandler
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.modules.common.mapper.CommonSqlMapper
;
import
com.skua.modules.system.entity.*
;
import
com.skua.modules.system.mapper.*
;
import
com.skua.modules.system.service.ISysUserDepartService
;
...
...
@@ -48,6 +49,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private
ISysBaseAPI
sysBaseAPI
;
@Autowired
private
SysDepartMapper
sysDepartMapper
;
@Resource
private
CommonSqlMapper
commonSqlMapper
;
@Autowired
WebSocket
webSocket
;
...
...
@@ -173,7 +176,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 根据角色Id查询
@Override
public
IPage
<
SysUser
>
getUserByRoleId
(
Page
<
SysUser
>
page
,
String
roleId
,
String
username
)
{
String
departIds
=
userMapper
.
queryDepartIdsByUserId
(
BaseContextHandler
.
getUserId
());
// String departIds = userMapper.queryDepartIdsByUserId(BaseContextHandler.getUserId());
String
ids
=
commonSqlMapper
.
getChildDepartByUserId
(
BaseContextHandler
.
getUserId
());
String
departIds
=
commonSqlMapper
.
getChildDeparts
(
ids
);
return
userMapper
.
getUserByRoleId
(
page
,
roleId
,
username
,
departIds
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论