Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
18b00dd5
提交
18b00dd5
编写于
12月 25, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 发布系统代码 [ibiz-uaa,UAA鉴权]
上级
89bb67ee
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
203 行增加
和
2 行删除
+203
-2
sys-users.ts
app_web/src/mock/entity/sys-users/sys-users.ts
+38
-0
sys-user-service-base.ts
app_web/src/service/sys-user/sys-user-service-base.ts
+14
-0
ISysUserService.java
...ain/java/cn/ibizlab/core/uaa/service/ISysUserService.java
+1
-0
SysUserServiceImpl.java
.../cn/ibizlab/core/uaa/service/impl/SysUserServiceImpl.java
+11
-0
ISysUserdeleteSysUserLogic.java
...ab/core/uaa/service/logic/ISysUserdeleteSysUserLogic.java
+18
-0
SysUserdeleteSysUserLogicImpl.java
...uaa/service/logic/impl/SysUserdeleteSysUserLogicImpl.java
+59
-0
RocketMQListenerProcessor.java
...n/ibizlab/core/util/config/RocketMQListenerProcessor.java
+1
-1
systemResource.json
...aa-core/src/main/resources/permission/systemResource.json
+1
-1
SysUserdeleteSysUserRule.drl
...ore/src/main/resources/rules/SysUserdeleteSysUserRule.drl
+31
-0
SysUserdeleteSysUserRuleFlow.bpmn
...rc/main/resources/rules/SysUserdeleteSysUserRuleFlow.bpmn
+18
-0
SysUserResource.java
...pi/src/main/java/cn/ibizlab/api/rest/SysUserResource.java
+11
-0
未找到文件。
app_web/src/mock/entity/sys-users/sys-users.ts
浏览文件 @
18b00dd5
...
...
@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return
[
status
,
data
];
});
// DeleteSysUser
mock
.
onPost
(
new
RegExp
(
/^
\/
sysusers
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
deletesysuser$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysuser 方法: DeleteSysUser"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysusers
\/([
a-zA-Z0-9
\-\;]{1,35})\/
deletesysuser$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userid, tempValue.userid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userid'
]
==
tempValue
[
'userid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sysusers
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysuser 方法: Save"
);
...
...
app_web/src/service/sys-user/sys-user-service-base.ts
浏览文件 @
18b00dd5
...
...
@@ -154,6 +154,20 @@ export default class SysUserServiceBase extends EntityService {
return
res
;
}
/**
* DeleteSysUser接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public
async
DeleteSysUser
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/sysusers/
${
context
.
sysuser
}
/deletesysuser`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/ISysUserService.java
浏览文件 @
18b00dd5
...
...
@@ -37,6 +37,7 @@ public interface ISysUserService extends IService<SysUser> {
SysUser
get
(
String
key
);
SysUser
getDraft
(
SysUser
et
);
boolean
checkKey
(
SysUser
et
);
SysUser
deleteSysUser
(
SysUser
et
);
boolean
save
(
SysUser
et
);
@CacheEvict
(
value
=
"sysuser"
,
allEntries
=
true
)
void
saveBatch
(
List
<
SysUser
>
list
);
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/impl/SysUserServiceImpl.java
浏览文件 @
18b00dd5
...
...
@@ -55,6 +55,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Lazy
protected
cn
.
ibizlab
.
core
.
uaa
.
service
.
ISysUserRoleService
sysuserroleService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
core
.
uaa
.
service
.
logic
.
ISysUserdeleteSysUserLogic
deletesysuserLogic
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
core
.
uaa
.
service
.
logic
.
ISysUsersaveSysUserLogic
savesysuserLogic
;
...
...
@@ -131,6 +135,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public
boolean
checkKey
(
SysUser
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getUserid
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getUserid
())));
}
@Override
@Transactional
public
SysUser
deleteSysUser
(
SysUser
et
)
{
deletesysuserLogic
.
execute
(
et
);
return
et
;
}
@Override
@Transactional
public
boolean
save
(
SysUser
et
)
{
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/logic/ISysUserdeleteSysUserLogic.java
0 → 100644
浏览文件 @
18b00dd5
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
;
/**
* 关系型数据实体[deleteSysUser] 对象
*/
public
interface
ISysUserdeleteSysUserLogic
{
void
execute
(
SysUser
et
)
;
}
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/service/logic/impl/SysUserdeleteSysUserLogicImpl.java
0 → 100644
浏览文件 @
18b00dd5
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.ISysUserdeleteSysUserLogic
;
import
cn.ibizlab.core.uaa.domain.SysUser
;
/**
* 关系型数据实体[deleteSysUser] 对象
*/
@Slf4j
@Service
public
class
SysUserdeleteSysUserLogicImpl
implements
ISysUserdeleteSysUserLogic
{
@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
(
"sysuserdeletesysuserdefault"
,
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.sysuserdeletesysuser"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"执行[删除用户信息]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
{
kieSession
.
destroy
();
}
}
}
}
ibzuaa-core/src/main/java/cn/ibizlab/core/util/config/RocketMQListenerProcessor.java
浏览文件 @
18b00dd5
...
...
@@ -40,7 +40,7 @@ public class RocketMQListenerProcessor implements MessageListenerOrderly {
log
.
info
(
"MQ消息topic={}, tags={}, 消息内容={}"
,
topic
,
tags
,
body
);
if
(
"deletesysuser"
.
equalsIgnoreCase
(
tags
))
{
cn
.
ibizlab
.
core
.
uaa
.
domain
.
SysUser
domain
=
JSON
.
parseObject
(
new
String
(
body
),
cn
.
ibizlab
.
core
.
uaa
.
domain
.
SysUser
.
class
);
SysUserService
.
remove
(
domain
);
SysUserService
.
deleteSysUser
(
domain
);
}
if
(
"savesysuser"
.
equalsIgnoreCase
(
tags
))
{
cn
.
ibizlab
.
core
.
uaa
.
domain
.
SysUser
domain
=
JSON
.
parseObject
(
new
String
(
body
),
cn
.
ibizlab
.
core
.
uaa
.
domain
.
SysUser
.
class
);
...
...
ibzuaa-core/src/main/resources/permission/systemResource.json
浏览文件 @
18b00dd5
...
...
@@ -64,7 +64,7 @@
"delogicname"
:
"系统用户"
,
"sysmoudle"
:{
"id"
:
"UAA"
,
"name"
:
"uaa"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"SaveSysUser"
,
"name"
:
"保存用户信息"
,
"type"
:
"DELOGIC"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"
DeleteSysUser"
,
"name"
:
"删除用户信息"
,
"type"
:
"DELOGIC"
},{
"id"
:
"
Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"SaveSysUser"
,
"name"
:
"保存用户信息"
,
"type"
:
"DELOGIC"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"curorg"
,
"name"
:
"当前单位"
},{
"id"
:
"porg"
,
"name"
:
"上级单位"
},{
"id"
:
"sorg"
,
"name"
:
"下级单位"
}
]
}
,
{
...
...
ibzuaa-core/src/main/resources/rules/SysUserdeleteSysUserRule.drl
0 → 100644
浏览文件 @
18b00dd5
package
cn
.
ibizlab
.
uaa
.
logic
.
sysuserlogic
.
deletesysuser
;
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
sysuserdeletesysuserdefault
;
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
"deaction1"
ruleflow
-
group
"sysuserdeletesysuserdeaction1"
when
then
sysuserservice
.
remove
(
sysuserdeletesysuserdefault
.
getUserid
());
update
(
sysuserdeletesysuserdefault
);//
更新
fact
中变量值
end
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"sysuserdeletesysuserbegin"
when
then
end
ibzuaa-core/src/main/resources/rules/SysUserdeleteSysUserRuleFlow.bpmn
0 → 100644
浏览文件 @
18b00dd5
<?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.sysuserdeletesysuser"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"cn.ibizlab.core.uaa.service.logic.sysuserdeletesysuser"
>
<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=
"sysuserdeletesysuserdefault"
type=
"cn.ibizlab.core.uaa.domain.SysUser"
/>
</extensionElements>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"sysuserdeletesysuserdeaction1"
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=
"begin_deaction1"
sourceRef=
"begin"
targetRef=
"deaction1"
>
</sequenceFlow>
</process>
</definitions>
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/SysUserResource.java
浏览文件 @
18b00dd5
...
...
@@ -120,6 +120,17 @@ public class SysUserResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserService
.
checkKey
(
sysuserMapping
.
toDomain
(
sysuserdto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-DeleteSysUser-all')"
)
@ApiOperation
(
value
=
"删除用户信息"
,
tags
=
{
"系统用户"
},
notes
=
"删除用户信息"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysusers/{sysuser_id}/deletesysuser"
)
public
ResponseEntity
<
SysUserDTO
>
deleteSysUser
(
@PathVariable
(
"sysuser_id"
)
String
sysuser_id
,
@RequestBody
SysUserDTO
sysuserdto
)
{
SysUser
domain
=
sysuserMapping
.
toDomain
(
sysuserdto
);
domain
.
setUserid
(
sysuser_id
);
domain
=
sysuserService
.
deleteSysUser
(
domain
);
sysuserdto
=
sysuserMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserdto
);
}
@PreAuthorize
(
"hasPermission(this.sysuserMapping.toDomain(#sysuserdto),'ibzuaa-SysUser-Save')"
)
@ApiOperation
(
value
=
"保存系统用户"
,
tags
=
{
"系统用户"
},
notes
=
"保存系统用户"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysusers/save"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录