Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
202d2e68
提交
202d2e68
编写于
12月 24, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 发布系统代码 [ibiz-uaa,UAA鉴权]
上级
0d5e8098
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
248 行增加
和
10 行删除
+248
-10
ISysUsersaveSysUserLogic.java
...zlab/core/uaa/service/logic/ISysUsersaveSysUserLogic.java
+18
-0
SysUsersaveSysUserLogicImpl.java
...e/uaa/service/logic/impl/SysUsersaveSysUserLogicImpl.java
+59
-0
RocketMQConfig.java
...main/java/cn/ibizlab/core/util/config/RocketMQConfig.java
+76
-0
h2_table.xml
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
+10
-10
SysUsersaveSysUserRule.drl
...-core/src/main/resources/rules/SysUsersaveSysUserRule.drl
+40
-0
SysUsersaveSysUserRuleFlow.bpmn
.../src/main/resources/rules/SysUsersaveSysUserRuleFlow.bpmn
+39
-0
pom.xml
ibzuaa-dependencies/pom.xml
+6
-0
未找到文件。
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/logic/ISysUsersaveSysUserLogic.java
0 → 100644
浏览文件 @
202d2e68
package
cn
.
ibizlab
.
core
.
uaa
.
service
.
logic
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
cn.ibizlab.core.uaa.domain.SysUser
;
/**
* 关系型数据实体[saveSysUser] 对象
*/
public
interface
ISysUsersaveSysUserLogic
{
void
execute
(
SysUser
et
)
;
}
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/logic/impl/SysUsersaveSysUserLogicImpl.java
0 → 100644
浏览文件 @
202d2e68
package
cn
.
ibizlab
.
core
.
uaa
.
service
.
logic
.
impl
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.kie.api.runtime.KieSession
;
import
org.kie.api.runtime.KieContainer
;
import
cn.ibizlab.core.uaa.service.logic.ISysUsersaveSysUserLogic
;
import
cn.ibizlab.core.uaa.domain.SysUser
;
/**
* 关系型数据实体[saveSysUser] 对象
*/
@Slf4j
@Service
public
class
SysUsersaveSysUserLogicImpl
implements
ISysUsersaveSysUserLogic
{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
sysuserservice
;
public
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
getSysuserService
()
{
return
this
.
sysuserservice
;
}
@Autowired
private
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
iBzSysDefaultService
;
public
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
getIBzSysDefaultService
()
{
return
this
.
iBzSysDefaultService
;
}
@Override
public
void
execute
(
SysUser
et
)
{
KieSession
kieSession
=
null
;
try
{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"sysusersavesysuserdefault"
,
et
);
kieSession
.
setGlobal
(
"sysuserservice"
,
sysuserservice
);
kieSession
.
setGlobal
(
"iBzSysSysuserDefaultService"
,
iBzSysDefaultService
);
kieSession
.
setGlobal
(
"curuser"
,
cn
.
ibizlab
.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
());
kieSession
.
startProcess
(
"cn.ibizlab.core.uaa.service.logic.sysusersavesysuser"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"执行[保存用户信息]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
{
kieSession
.
destroy
();
}
}
}
}
ibzuaa-core/src/main/java/cn/ibizlab/core/util/config/RocketMQConfig.java
0 → 100644
浏览文件 @
202d2e68
package
cn
.
ibizlab
.
core
.
util
.
config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.rocketmq.client.consumer.DefaultMQPushConsumer
;
import
com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext
;
import
com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus
;
import
com.alibaba.rocketmq.client.consumer.listener.MessageListenerConcurrently
;
import
com.alibaba.rocketmq.client.producer.DefaultMQProducer
;
import
com.alibaba.rocketmq.common.message.MessageExt
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Lazy
;
import
java.util.List
;
@Slf4j
@Configuration
public
class
RocketMQConfig
{
@Autowired
@Lazy
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
SysUserService
;
@Bean
(
"SysUserdeleteSysUserconsumer"
)
public
DefaultMQPushConsumer
sysUserdeleteSysUserconsumer
(){
DefaultMQPushConsumer
consumer
=
null
;
try
{
consumer
=
new
DefaultMQPushConsumer
();
consumer
.
setNamesrvAddr
(
"127.0.0.1:9876"
);
consumer
.
setInstanceName
(
"rmq-instance"
);
consumer
.
subscribe
(
"deleteSysUser"
,
"deleteSysUser"
);
consumer
.
registerMessageListener
(
new
MessageListenerConcurrently
()
{
public
ConsumeConcurrentlyStatus
consumeMessage
(
List
<
MessageExt
>
msgs
,
ConsumeConcurrentlyContext
context
)
{
for
(
MessageExt
msg
:
msgs
)
{
log
.
info
(
"接收到[]消息,但未配置实体输入过滤行为,消息将被忽略。"
+
new
String
(
msg
.
getBody
()));
}
return
ConsumeConcurrentlyStatus
.
CONSUME_SUCCESS
;
}
});
consumer
.
start
();
}
catch
(
Exception
e
){
log
.
error
(
"初始化消息接收对象异常!"
);
}
return
consumer
;
}
@Autowired
@Lazy
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
SysUserService
;
@Bean
(
"SysUsersaveSysUserconsumer"
)
public
DefaultMQPushConsumer
sysUsersaveSysUserconsumer
(){
DefaultMQPushConsumer
consumer
=
null
;
try
{
consumer
=
new
DefaultMQPushConsumer
();
consumer
.
setNamesrvAddr
(
"127.0.0.1:9876"
);
consumer
.
setInstanceName
(
"rmq-instance"
);
consumer
.
subscribe
(
"saveSysUser"
,
"saveSysUser"
);
consumer
.
registerMessageListener
(
new
MessageListenerConcurrently
()
{
public
ConsumeConcurrentlyStatus
consumeMessage
(
List
<
MessageExt
>
msgs
,
ConsumeConcurrentlyContext
context
)
{
for
(
MessageExt
msg
:
msgs
)
{
log
.
info
(
"接收到[]消息,但未配置实体输入过滤行为,消息将被忽略。"
+
new
String
(
msg
.
getBody
()));
}
return
ConsumeConcurrentlyStatus
.
CONSUME_SUCCESS
;
}
});
consumer
.
start
();
}
catch
(
Exception
e
){
log
.
error
(
"初始化消息接收对象异常!"
);
}
return
consumer
;
}
}
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
202d2e68
...
...
@@ -6,7 +6,7 @@
<!--输出实体[SYS_AUTHLOG]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-sys_authlog-3-1"
>
<changeSet
author=
"
root
"
id=
"tab-sys_authlog-3-1"
>
<createTable
tableName=
"IBZAUTHLOG"
>
<column
name=
"LOGID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_AUTHLOG_LOGID"
/>
...
...
@@ -32,7 +32,7 @@
<!--输出实体[SYS_OPEN_ACCESS]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-sys_open_access-37-2"
>
<changeSet
author=
"
root
"
id=
"tab-sys_open_access-37-2"
>
<createTable
tableName=
"IBZOPENACCESS"
>
<column
name=
"ACCESSID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_OPEN_ACCESS_ACCESSID"
/>
...
...
@@ -64,7 +64,7 @@
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-sys_pssystem-1-3"
>
<changeSet
author=
"
root
"
id=
"tab-sys_pssystem-1-3"
>
<createTable
tableName=
"IBZPSSYSTEM"
>
<column
name=
"PSSYSTEMID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PSSYSTEM_PSSYSTEMID"
/>
...
...
@@ -84,7 +84,7 @@
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509"
id=
"tab-sys_permission-7
-4"
>
<changeSet
author=
"
root"
id=
"tab-sys_permission-8
-4"
>
<createTable
tableName=
"IBZPERMISSION"
>
<column
name=
"SYS_PERMISSIONID"
remarks=
""
type=
"VARCHAR(200)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PERMISSION_SYS_PERMISSI"
/>
...
...
@@ -106,7 +106,7 @@
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509"
id=
"tab-sys_role-44
-5"
>
<changeSet
author=
"
root"
id=
"tab-sys_role-49
-5"
>
<createTable
tableName=
"IBZROLE"
>
<column
name=
"SYS_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_SYS_ROLEID"
/>
...
...
@@ -130,7 +130,7 @@
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509"
id=
"tab-sys_role_permission-19
-6"
>
<changeSet
author=
"
root"
id=
"tab-sys_role_permission-25
-6"
>
<createTable
tableName=
"IBZROLE_PERMISSION"
>
<column
name=
"SYS_ROLE_PERMISSIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_PERMISSION_SYS_ROL"
/>
...
...
@@ -150,7 +150,7 @@
<!--输出实体[SYS_USER_AUTH]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-sys_user_auth-22-7"
>
<changeSet
author=
"
root
"
id=
"tab-sys_user_auth-22-7"
>
<createTable
tableName=
"IBZUSERAUTH"
>
<column
name=
"AUTHID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_AUTH_AUTHID"
/>
...
...
@@ -168,7 +168,7 @@
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-sys_user_role-13-8"
>
<changeSet
author=
"
root
"
id=
"tab-sys_user_role-13-8"
>
<createTable
tableName=
"IBZUSER_ROLE"
>
<column
name=
"SYS_USER_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_ROLE_SYS_USER_ROLE"
/>
...
...
@@ -189,13 +189,13 @@
<!--输出实体[SYS_PSSYSTEM]外键关系 -->
<!--输出实体[SYS_PERMISSION]外键关系 -->
<!--输出实体[SYS_ROLE]外键关系 -->
<changeSet
author=
"
a_A_5d9d78509"
id=
"fk-sys_role-44
-9"
>
<changeSet
author=
"
root"
id=
"fk-sys_role-49
-9"
>
<addForeignKeyConstraint
baseColumnNames=
"PROLEID"
baseTableName=
"IBZROLE"
constraintName=
"DER1N_SYS_ROLE_SYS_ROLE_PROLEI"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_ROLEID"
referencedTableName=
"IBZROLE"
validate=
"true"
/>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<!--输出实体[SYS_USER_AUTH]外键关系 -->
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"fk-sys_user_role-13-10"
>
<changeSet
author=
"
root
"
id=
"fk-sys_user_role-13-10"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_ROLEID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_ROLE_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_ROLEID"
referencedTableName=
"IBZROLE"
validate=
"true"
/>
</changeSet>
...
...
ibzuaa-core/src/main/resources/rules/SysUsersaveSysUserRule.drl
0 → 100644
浏览文件 @
202d2e68
package
cn
.
ibizlab
.
uaa
.
logic
.
sysuserlogic
.
savesysuser
;
import
java
.
util
.
Map
;
import
java
.
util
.
HashMap
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
util
.
ObjectUtils
;
import
cn
.
ibizlab
.
util
.
errors
.
BadRequestAlertException
;
global
cn
.
ibizlab
.
core
.
uaa
.
domain
.
SysUser
sysusersavesysuserdefault
;
global
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
sysuserservice
;
global
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserService
iBzSysSysuserDefaultService
;
global
cn
.
ibizlab
.
util
.
security
.
AuthenticationUser
curuser
;
no
-
loop
//
逻辑处理节点
[
设置用户为管理员
]
rule
"prepareparam1"
ruleflow
-
group
"sysusersavesysuserprepareparam1"
when
then
sysusersavesysuserdefault
.
set
(
"superuser"
,
"1"
);
update
(
sysusersavesysuserdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
保存用户
]
rule
"deaction1"
ruleflow
-
group
"sysusersavesysuserdeaction1"
when
then
sysuserservice
.
save
(
sysusersavesysuserdefault
);
update
(
sysusersavesysuserdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"sysusersavesysuserbegin"
when
then
end
ibzuaa-core/src/main/resources/rules/SysUsersaveSysUserRuleFlow.bpmn
0 → 100644
浏览文件 @
202d2e68
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"cn.ibizlab.core.uaa.service.logic.sysusersavesysuser"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"cn.ibizlab.core.uaa.service.logic.sysusersavesysuser"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"cn.ibizlab.util.helper.RuleUtils"
/>
<tns:global
identifier=
"sysusersavesysuserdefault"
type=
"cn.ibizlab.core.uaa.domain.SysUser"
/>
</extensionElements>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"sysusersavesysuserprepareparam1"
id=
"prepareparam1"
implementation=
"http://www.jboss.org/drools/rule"
name=
"设置用户为管理员"
/>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"sysusersavesysuserdeaction1"
id=
"deaction1"
implementation=
"http://www.jboss.org/drools/rule"
name=
"保存用户"
/>
<endEvent
id=
"deaction1_end"
name=
"end"
/>
<sequenceFlow
id=
"deaction1_end_line"
sourceRef=
"deaction1"
targetRef=
"deaction1_end"
/>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<sequenceFlow
id=
"gateway-begin_prepareparam1"
sourceRef=
"gateway-begin"
targetRef=
"prepareparam1"
>
<conditionExpression
language=
"http://www.jboss.org/drools/rule"
>
<![CDATA[
$sysusersavesysuserdefault:SysUser();
eval($sysusersavesysuserdefault==sysusersavesysuserdefault);
eval((RuleUtils.test($sysusersavesysuserdefault.get("loginname"),"EQ","ibzadmin")))
]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow
id=
"gateway-begin_deaction1"
sourceRef=
"gateway-begin"
targetRef=
"deaction1"
>
<conditionExpression
language=
"http://www.jboss.org/drools/rule"
>
<![CDATA[
$sysusersavesysuserdefault:SysUser();
eval($sysusersavesysuserdefault==sysusersavesysuserdefault);
eval((RuleUtils.test($sysusersavesysuserdefault.get("loginname"),"NOTEQ","ibzadmin")))
]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow
id=
"prepareparam1_deaction1"
sourceRef=
"prepareparam1"
targetRef=
"deaction1"
>
</sequenceFlow>
<exclusiveGateway
id=
"gateway-begin"
name=
"Gateway"
gatewayDirection=
"Diverging"
default=
"gateway-begin_end_line"
></exclusiveGateway>
<sequenceFlow
id=
"begin_gateway-begin_gatewayline"
sourceRef=
"begin"
targetRef=
"gateway-begin"
></sequenceFlow>
<sequenceFlow
id=
"gateway-begin_end_line"
sourceRef=
"gateway-begin"
targetRef=
"gateway-begin_end"
/>
<endEvent
id=
"gateway-begin_end"
name=
"end"
/>
</process>
</definitions>
ibzuaa-dependencies/pom.xml
浏览文件 @
202d2e68
...
...
@@ -85,6 +85,7 @@
<oracle.version>
19.8.0.0
</oracle.version>
<postgresql.version>
42.2.6
</postgresql.version>
<rocketmq.version>
4.7.0
</rocketmq.version>
</properties>
...
...
@@ -261,6 +262,11 @@
<version>
${baomidou-jobs.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-client
</artifactId>
<version>
${rocketmq.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录