Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZTGK
hzsomms
Commits
10ff90f5
Commit
10ff90f5
authored
1 year ago
by
hkl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-hkl' into 'dev'
Dev hkl See merge request
!5
parents
074d672a
31cbe5f2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
464 additions
and
137 deletions
+464
-137
ISysBaseAPI.java
...rc/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
+436
-0
pom.xml
jeecg-module-system/pom.xml
+0
-4
CodeGenerate.java
...em/src/main/java/org/jeecg/codegenerate/CodeGenerate.java
+1
-1
JimuReportTokenService.java
...a/org/jeecg/config/jimureport/JimuReportTokenService.java
+0
-69
SystemSendMsgHandle.java
...eecg/modules/message/handle/impl/SystemSendMsgHandle.java
+21
-19
dto.java.ftl
...g-module-system/src/main/resources/generator/dto.java.ftl
+3
-32
vo.java.ftl
jeecg-module-system/src/main/resources/generator/vo.java.ftl
+3
-12
No files found.
jeecg-boot-base-core/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
0 → 100644
View file @
10ff90f5
package
org
.
jeecg
.
common
.
system
.
api
;
import
com.alibaba.fastjson.JSONObject
;
import
org.jeecg.common.api.CommonAPI
;
import
org.jeecg.common.api.dto.DataLogDTO
;
import
org.jeecg.common.api.dto.OnlineAuthDTO
;
import
org.jeecg.common.api.dto.message.*
;
import
org.jeecg.common.system.vo.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @Description 底层共通业务API,提供其他独立模块调用
* @Author scott
* @Date 2019-4-20
* @Version V1.0
*/
public
interface
ISysBaseAPI
extends
CommonAPI
{
/**
* 1发送系统消息
*
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
*/
void
sendSysAnnouncement
(
MessageDTO
message
);
/**
* 2发送消息 附带业务参数
*
* @param message 使用构造器赋值参数
*/
void
sendBusAnnouncement
(
BusMessageDTO
message
);
/**
* 3通过模板发送消息
*
* @param message 使用构造器赋值参数
*/
void
sendTemplateAnnouncement
(
TemplateMessageDTO
message
);
/**
* 4通过模板发送消息 附带业务参数
*
* @param message 使用构造器赋值参数
*/
void
sendBusTemplateAnnouncement
(
BusTemplateMessageDTO
message
);
/**
* 5通过消息中心模板,生成推送内容
*
* @param templateDTO 使用构造器赋值参数
* @return
*/
String
parseTemplateByCode
(
TemplateDTO
templateDTO
);
//update-begin---author:taoyan ---date:20220705 for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
/**
* 发送模板消息【新,支持自定义推送类型】
*
* @param message
*/
void
sendTemplateMessage
(
MessageDTO
message
);
/**
* 根据模板编码获取模板内容【新,支持自定义推送类型】
*
* @param templateCode
* @return
*/
String
getTemplateContent
(
String
templateCode
);
//update-begin---author:taoyan ---date:20220705 for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
/**
* 6根据用户id查询用户信息
*
* @param id
* @return
*/
LoginUser
getUserById
(
String
id
);
/**
* 7通过用户账号查询角色集合
*
* @param username
* @return
*/
List
<
String
>
getRolesByUsername
(
String
username
);
/**
* 8通过用户账号查询部门集合
*
* @param username
* @return 部门 id
*/
List
<
String
>
getDepartIdsByUsername
(
String
username
);
/**
* 9通过用户账号查询部门 name
*
* @param username
* @return 部门 name
*/
List
<
String
>
getDepartNamesByUsername
(
String
username
);
/**
* 11查询所有的父级字典,按照create_time排序
*
* @return List<DictModel> 字典集合
*/
public
List
<
DictModel
>
queryAllDict
();
/**
* 12查询所有分类字典
*
* @return
*/
public
List
<
SysCategoryModel
>
queryAllSysCategory
();
/**
* 14查询所有部门 作为字典信息 id -->value,departName -->text
*
* @return
*/
public
List
<
DictModel
>
queryAllDepartBackDictModel
();
/**
* 15根据业务类型及业务id修改消息已读
*
* @param busType
* @param busId
*/
public
void
updateSysAnnounReadFlag
(
String
busType
,
String
busId
);
/**
* 16查询表字典 支持过滤数据
*
* @param table
* @param text
* @param code
* @param filterSql
* @return
*/
public
List
<
DictModel
>
queryFilterTableDictInfo
(
String
table
,
String
text
,
String
code
,
String
filterSql
);
/**
* 17查询指定table的 text code 获取字典,包含text和value
*
* @param table
* @param text
* @param code
* @param keyArray
* @return
*/
@Deprecated
public
List
<
String
>
queryTableDictByKeys
(
String
table
,
String
text
,
String
code
,
String
[]
keyArray
);
/**
* 18查询所有用户 返回ComboModel
*
* @return
*/
public
List
<
ComboModel
>
queryAllUserBackCombo
();
/**
* 19分页查询用户 返回JSONObject
*
* @param userIds 多个用户id
* @param pageNo 当前页数
* @param pageSize 每页显示条数
* @return
*/
public
JSONObject
queryAllUser
(
String
userIds
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 20获取所有角色
*
* @return
*/
public
List
<
ComboModel
>
queryAllRole
();
/**
* 21获取所有角色 带参
*
* @param roleIds 默认选中角色
* @return
*/
public
List
<
ComboModel
>
queryAllRole
(
String
[]
roleIds
);
/**
* 22通过用户账号查询角色Id集合
*
* @param username
* @return
*/
public
List
<
String
>
getRoleIdsByUsername
(
String
username
);
/**
* 23通过部门编号查询部门id
*
* @param orgCode
* @return
*/
public
String
getDepartIdsByOrgCode
(
String
orgCode
);
/**
* 24查询所有部门
*
* @return
*/
public
List
<
SysDepartModel
>
getAllSysDepart
();
/**
* 25查找父级部门
*
* @param departId
* @return
*/
DictModel
getParentDepartId
(
String
departId
);
/**
* 26根据部门Id获取部门负责人
*
* @param deptId
* @return
*/
public
List
<
String
>
getDeptHeadByDepId
(
String
deptId
);
/**
* 27给指定用户发消息
*
* @param userIds
* @param cmd
*/
public
void
sendWebSocketMsg
(
String
[]
userIds
,
String
cmd
);
/**
* 28根据id获取所有参与用户
*
* @param userIds 多个用户id
* @return
*/
public
List
<
LoginUser
>
queryAllUserByIds
(
String
[]
userIds
);
/**
* 29将会议签到信息推动到预览
* userIds
*
* @param userId
* @return
*/
void
meetingSignWebsocket
(
String
userId
);
/**
* 30根据name获取所有参与用户
*
* @param userNames 多个用户账户
* @return
*/
List
<
LoginUser
>
queryUserByNames
(
String
[]
userNames
);
/**
* 31获取用户的角色集合
*
* @param username
* @return
*/
Set
<
String
>
getUserRoleSet
(
String
username
);
/**
* 32获取用户的权限集合
*
* @param username
* @return
*/
Set
<
String
>
getUserPermissionSet
(
String
username
);
/**
* 33判断是否有online访问的权限
*
* @param onlineAuthDTO
* @return
*/
boolean
hasOnlineAuth
(
OnlineAuthDTO
onlineAuthDTO
);
/**
* 34通过部门id获取部门全部信息
*
* @param id 部门id
* @return SysDepartModel对象
*/
SysDepartModel
selectAllById
(
String
id
);
/**
* 35根据用户id查询用户所属公司下所有用户ids
*
* @param userId
* @return
*/
List
<
String
>
queryDeptUsersByUserId
(
String
userId
);
/**
* 36根据多个用户账号(逗号分隔),查询返回多个用户信息
*
* @param usernames
* @return
*/
List
<
JSONObject
>
queryUsersByUsernames
(
String
usernames
);
/**
* 37根据多个用户ID(逗号分隔),查询返回多个用户信息
*
* @param ids
* @return
*/
List
<
JSONObject
>
queryUsersByIds
(
String
ids
);
/**
* 38根据多个部门编码(逗号分隔),查询返回多个部门信息
*
* @param orgCodes
* @return
*/
List
<
JSONObject
>
queryDepartsByOrgcodes
(
String
orgCodes
);
/**
* 39根据多个部门id(逗号分隔),查询返回多个部门信息
*
* @param ids
* @return
*/
List
<
JSONObject
>
queryDepartsByIds
(
String
ids
);
/**
* 40发送邮件消息
*
* @param email
* @param title
* @param content
*/
void
sendEmailMsg
(
String
email
,
String
title
,
String
content
);
/**
* 41 获取公司下级部门和公司下所有用户信息
*
* @param orgCode
* @return List<Map>
*/
List
<
Map
>
getDeptUserByOrgCode
(
String
orgCode
);
/**
* 查询分类字典翻译
*
* @param ids 多个分类字典id
* @return List<String>
*/
List
<
String
>
loadCategoryDictItem
(
String
ids
);
/**
* 根据字典code加载字典text
*
* @param dictCode 顺序:tableName,text,code
* @param keys 要查询的key
* @return
*/
List
<
String
>
loadDictItem
(
String
dictCode
,
String
keys
);
/**
* 根据字典code查询字典项
*
* @param dictCode 顺序:tableName,text,code
* @param dictCode 要查询的key
* @return
*/
List
<
DictModel
>
getDictItems
(
String
dictCode
);
/**
* 根据多个字典code查询多个字典项
*
* @param dictCodeList
* @return key = dictCode ; value=对应的字典项
*/
Map
<
String
,
List
<
DictModel
>>
getManyDictItems
(
List
<
String
>
dictCodeList
);
/**
* 【JSearchSelectTag下拉搜索组件专用接口】
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据
*
* @param dictCode 字典code格式:table,text,code
* @param keyword 过滤关键字
* @param pageSize 分页条数
* @return
*/
List
<
DictModel
>
loadDictItemByKeyword
(
String
dictCode
,
String
keyword
,
Integer
pageSize
);
/**
* 新增数据日志
*
* @param dataLogDto
*/
void
saveDataLog
(
DataLogDTO
dataLogDto
);
/**
* 添加文件到知识库
*
* @param sysFilesModel
*/
void
addSysFiles
(
SysFilesModel
sysFilesModel
);
/**
* 通过文件路径获取文件id
*
* @param fileId
*/
String
getFileUrl
(
String
fileId
);
/**
* 更新头像
*
* @param loginUser
*/
void
updateAvatar
(
LoginUser
loginUser
);
/**
* 向app端 websocket推送聊天刷新消息
*
* @param userId
*/
void
sendAppChatSocket
(
String
userId
);
}
This diff is collapsed.
Click to expand it.
jeecg-module-system/pom.xml
View file @
10ff90f5
...
...
@@ -22,10 +22,6 @@
<artifactId>
TinyPinyin
</artifactId>
<version>
2.0.3.RELEASE
</version>
</dependency>
<dependency>
<groupId>
org.jeecgframework.boot
</groupId>
<artifactId>
jeecg-system-local-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-core
</artifactId>
...
...
This diff is collapsed.
Click to expand it.
jeecg-module-system/src/main/java/org/jeecg/codegenerate/CodeGenerate.java
View file @
10ff90f5
...
...
@@ -22,7 +22,7 @@ public class CodeGenerate {
System
.
out
.
println
(
"projectPath = "
+
projectPath
);
// 输出目录
String
outputDir
=
projectPath
+
"\\jeecg-module-system\\
jeecg-system-biz\\
src\\main\\java\\"
;
String
outputDir
=
projectPath
+
"\\jeecg-module-system\\src\\main\\java\\"
;
// 模块名
String
moduleName
=
"deviceAsset"
;
...
...
This diff is collapsed.
Click to expand it.
jeecg-module-system/src/main/java/org/jeecg/config/jimureport/JimuReportTokenService.java
deleted
100644 → 0
View file @
074d672a
package
org
.
jeecg
.
config
.
jimureport
;
import
lombok.extern.slf4j.Slf4j
;
import
org.jeecg.common.system.util.JwtUtil
;
import
org.jeecg.common.system.vo.SysUserCacheInfo
;
import
org.jeecg.common.util.RedisUtil
;
import
org.jeecg.common.util.TokenUtils
;
import
org.jeecg.modules.jmreport.api.JmReportTokenServiceI
;
import
org.jeecg.modules.system.service.impl.SysBaseApiImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
* * 1.自定义获取登录token
* * 2.自定义获取登录用户
* @author: jeecg-boot
*/
@Slf4j
@Component
public
class
JimuReportTokenService
implements
JmReportTokenServiceI
{
@Autowired
private
SysBaseApiImpl
sysBaseApi
;
@Autowired
@Lazy
private
RedisUtil
redisUtil
;
@Override
public
String
getToken
(
HttpServletRequest
request
)
{
return
TokenUtils
.
getTokenByRequest
(
request
);
}
@Override
public
String
getUsername
(
String
token
)
{
return
JwtUtil
.
getUsername
(
token
);
}
@Override
public
Boolean
verifyToken
(
String
token
)
{
return
TokenUtils
.
verifyToken
(
token
,
sysBaseApi
,
redisUtil
);
}
@Override
public
Map
<
String
,
Object
>
getUserInfo
(
String
token
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
(
5
);
String
username
=
JwtUtil
.
getUsername
(
token
);
//此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义
SysUserCacheInfo
userInfo
=
null
;
try
{
userInfo
=
sysBaseApi
.
getCacheUser
(
username
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取用户信息异常:"
+
e
.
getMessage
());
return
map
;
}
//设置账号名
map
.
put
(
SYS_USER_CODE
,
userInfo
.
getSysUserCode
());
//设置部门编码
map
.
put
(
SYS_ORG_CODE
,
userInfo
.
getSysOrgCode
());
// 将所有信息存放至map 解析sql/api会根据map的键值解析
return
map
;
}
}
This diff is collapsed.
Click to expand it.
jeecg-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java
View file @
10ff90f5
...
...
@@ -24,14 +24,14 @@ import java.util.Date;
import
java.util.Map
;
/**
* @Description: 发送系统消息
* @Author: wangshuai
* @Date: 2022年3月22日 18:48:20
*/
* @Description: 发送系统消息
* @Author: wangshuai
* @Date: 2022年3月22日 18:48:20
*/
@Component
(
"systemSendMsgHandle"
)
public
class
SystemSendMsgHandle
implements
ISendMsgHandle
{
public
static
final
String
FROM_USER
=
"system"
;
public
static
final
String
FROM_USER
=
"system"
;
@Resource
private
SysAnnouncementMapper
sysAnnouncementMapper
;
...
...
@@ -47,22 +47,24 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
/**
* 该方法会发送3种消息:系统消息、企业微信 钉钉
*
* @param esReceiver 发送人
* @param esTitle 标题
* @param esContent 内容
*/
@Override
public
void
sendMsg
(
String
esReceiver
,
String
esTitle
,
String
esContent
)
{
if
(
oConvertUtils
.
isEmpty
(
esReceiver
))
{
if
(
oConvertUtils
.
isEmpty
(
esReceiver
))
{
throw
new
JeecgBootException
(
"被发送人不能为空"
);
}
ISysBaseAPI
sysBaseApi
=
SpringContextUtils
.
getBean
(
ISysBaseAPI
.
class
);
MessageDTO
messageDTO
=
new
MessageDTO
(
FROM_USER
,
esReceiver
,
esTitle
,
esContent
);
MessageDTO
messageDTO
=
new
MessageDTO
(
FROM_USER
,
esReceiver
,
esTitle
,
esContent
);
sysBaseApi
.
sendSysAnnouncement
(
messageDTO
);
}
/**
* 仅发送系统消息
*
* @param messageDTO
*/
@Override
...
...
@@ -71,24 +73,24 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
String
title
=
messageDTO
.
getTitle
();
String
content
=
messageDTO
.
getContent
();
String
fromUser
=
messageDTO
.
getFromUser
();
Map
<
String
,
Object
>
data
=
messageDTO
.
getData
();
Map
<
String
,
Object
>
data
=
messageDTO
.
getData
();
String
[]
arr
=
messageDTO
.
getToUser
().
split
(
","
);
for
(
String
username:
arr
)
{
for
(
String
username
:
arr
)
{
doSend
(
title
,
content
,
fromUser
,
username
,
data
);
}
}
private
void
doSend
(
String
title
,
String
msgContent
,
String
fromUser
,
String
toUser
,
Map
<
String
,
Object
>
data
){
private
void
doSend
(
String
title
,
String
msgContent
,
String
fromUser
,
String
toUser
,
Map
<
String
,
Object
>
data
)
{
SysAnnouncement
announcement
=
new
SysAnnouncement
();
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
//摘要信息
Object
msgAbstract
=
data
.
get
(
CommonConstant
.
NOTICE_MSG_SUMMARY
);
if
(
msgAbstract
!=
null
)
{
if
(
msgAbstract
!=
null
)
{
announcement
.
setMsgAbstract
(
msgAbstract
.
toString
());
}
// 任务节点ID
Object
taskId
=
data
.
get
(
CommonConstant
.
NOTICE_MSG_BUS_ID
);
if
(
taskId
!=
null
)
{
if
(
taskId
!=
null
)
{
announcement
.
setBusId
(
taskId
.
toString
());
announcement
.
setBusType
(
Vue3MessageHrefEnum
.
BPM_TASK
.
getBusType
());
}
...
...
@@ -108,10 +110,10 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
String
userId
=
toUser
;
String
[]
userIds
=
userId
.
split
(
","
);
String
anntId
=
announcement
.
getId
();
for
(
int
i
=
0
;
i
<
userIds
.
length
;
i
++)
{
if
(
oConvertUtils
.
isNotEmpty
(
userIds
[
i
]))
{
for
(
int
i
=
0
;
i
<
userIds
.
length
;
i
++)
{
if
(
oConvertUtils
.
isNotEmpty
(
userIds
[
i
]))
{
SysUser
sysUser
=
userMapper
.
getUserByName
(
userIds
[
i
]);
if
(
sysUser
==
null
)
{
if
(
sysUser
==
null
)
{
continue
;
}
SysAnnouncementSend
announcementSend
=
new
SysAnnouncementSend
();
...
...
This diff is collapsed.
Click to expand it.
jeecg-module-system/src/main/resources/generator/dto.java.ftl
View file @
10ff90f5
...
...
@@ -30,21 +30,12 @@ package ${package.Entity};
@
Accessors
(
chain
=
true
)
</#
if
>
</#
if
>
<#
if
table
.
convert
>
@
TableName
(
"${schemaName}${table.name}"
)
</#
if
>
<#
if
swagger
>
@
ApiModel
(
value
=
"${entity}对象"
,
description
=
"${table.comment!}"
)
</#
if
>
<#
if
superEntityClass
??>
public
class
${
entity
}
extends
${
superEntityClass
}<#
if
activeRecord
><${
entity
}></#
if
>
{
<#
elseif
activeRecord
>
public
class
${
entity
}
extends
Model
<${
entity
}>
{
<#
elseif
entitySerialVersionUID
>
public
class
${
entity
}
implements
Serializable
{
<#
else
>
public
class
${
entity
}
{
</#
if
>
public
class
${
entity
}
DTO
{
<#
if
entitySerialVersionUID
>
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -64,26 +55,6 @@ package ${package.Entity};
*/
</#
if
>
</#
if
>
<#
if
field
.
keyFlag
>
<#--
主键
-->
<#
if
field
.
keyIdentityFlag
>
@
TableId
(
value
=
"${field.annotationColumnName}"
,
type
=
IdType
.
AUTO
)
<#
elseif
idType
??>
@
TableId
(
value
=
"${field.annotationColumnName}"
,
type
=
IdType
.${
idType
})
<#
elseif
field
.
convert
>
@
TableId
(
"${field.annotationColumnName}"
)
</#
if
>
<#--
普通字段
-->
<#
elseif
field
.
fill
??>
<#--
-----
存在字段填充设置
----->
<#
if
field
.
convert
>
@
TableField
(
value
=
"${field.annotationColumnName}"
,
fill
=
FieldFill
.${
field
.
fill
})
<#
else
>
@
TableField
(
fill
=
FieldFill
.${
field
.
fill
})
</#
if
>
<#
elseif
field
.
convert
>
@
TableField
(
"${field.annotationColumnName}"
)
</#
if
>
<#--
乐观锁注解
-->
<#
if
field
.
versionField
>
@
Version
...
...
This diff is collapsed.
Click to expand it.
jeecg-module-system/src/main/resources/generator/vo.java.ftl
View file @
10ff90f5
...
...
@@ -30,21 +30,12 @@ package ${package.Entity};
@
Accessors
(
chain
=
true
)
</#
if
>
</#
if
>
<#
if
table
.
convert
>
@
TableName
(
"${schemaName}${table.name}"
)
</#
if
>
<#
if
swagger
>
@
ApiModel
(
value
=
"${entity}对象"
,
description
=
"${table.comment!}"
)
</#
if
>
<#
if
superEntityClass
??>
public
class
${
entity
}
extends
${
superEntityClass
}<#
if
activeRecord
><${
entity
}></#
if
>
{
<#
elseif
activeRecord
>
public
class
${
entity
}
extends
Model
<${
entity
}>
{
<#
elseif
entitySerialVersionUID
>
public
class
${
entity
}
implements
Serializable
{
<#
else
>
public
class
${
entity
}
{
</#
if
>
public
class
${
entity
}
VO
{
<#
if
entitySerialVersionUID
>
private
static
final
long
serialVersionUID
=
1L
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment