Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Alex_81D
o2oa
提交
db7406e5
o2oa
项目概览
Alex_81D
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db7406e5
编写于
1月 10, 2023
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/druid' into 'develop'
修复导入应用没有刷新缓存 See merge request o2oa/o2oa!1380
上级
545f09c7
fdf6d041
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
418 addition
and
352 deletion
+418
-352
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionCreate.java
...orm/assemble/designer/jaxrs/application/ActionCreate.java
+44
-35
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionEdit.java
...tform/assemble/designer/jaxrs/application/ActionEdit.java
+45
-38
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/input/ActionCreate.java
...splatform/assemble/designer/jaxrs/input/ActionCreate.java
+329
-279
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionCreate.java
浏览文件 @
db7406e5
...
...
@@ -12,6 +12,8 @@ import com.x.base.core.project.cache.CacheManager;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.designer.Business
;
...
...
@@ -20,46 +22,53 @@ import com.x.processplatform.core.entity.element.Application;
class
ActionCreate
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
/* 这里的角色多一个 RoleDefinition.ProcessPlatformCreator */
if
((
effectivePerson
.
isNotManager
())
&&
(!
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
,
OrganizationDefinition
.
ProcessPlatformCreator
)))
{
throw
new
ExceptionInsufficientPermission
(
effectivePerson
.
getDistinguishedName
());
}
emc
.
beginTransaction
(
Application
.
class
);
Application
application
=
new
Application
();
Wi
.
copier
.
copy
(
wi
,
application
);
application
.
setCreatorPerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdateTime
(
new
Date
());
application
.
setControllerList
(
ListTools
.
add
(
application
.
getControllerList
(),
true
,
true
,
effectivePerson
.
getDistinguishedName
()));
emc
.
persist
(
application
,
CheckPersistType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Application
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
application
.
getId
());
result
.
setData
(
wo
);
MessageFactory
.
application_create
(
application
);
return
result
;
}
}
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
public
static
class
Wo
extends
WoId
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
// 这里的角色多一个 RoleDefinition.ProcessPlatformCreator
if
((
effectivePerson
.
isNotManager
())
&&
(!
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
,
OrganizationDefinition
.
ProcessPlatformCreator
)))
{
throw
new
ExceptionInsufficientPermission
(
effectivePerson
.
getDistinguishedName
());
}
emc
.
beginTransaction
(
Application
.
class
);
Application
application
=
new
Application
();
Wi
.
copier
.
copy
(
wi
,
application
);
// 如果是管理员就不写入到创建者
if
(!
effectivePerson
.
isManager
())
{
application
.
setCreatorPerson
(
effectivePerson
.
getDistinguishedName
());
}
application
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdateTime
(
new
Date
());
application
.
setControllerList
(
ListTools
.
add
(
application
.
getControllerList
(),
true
,
true
,
effectivePerson
.
getDistinguishedName
()));
emc
.
persist
(
application
,
CheckPersistType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Application
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
application
.
getId
());
result
.
setData
(
wo
);
MessageFactory
.
application_create
(
application
);
return
result
;
}
}
}
public
static
class
Wo
extends
WoId
{
public
static
class
Wi
extends
Application
{
}
private
static
final
long
serialVersionUID
=
6624639107781167248L
;
public
static
class
Wi
extends
Application
{
static
WrapCopier
<
Wi
,
Application
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Application
.
class
,
null
,
FieldsUnmodifyIncludePorperties
);
private
static
final
long
serialVersionUID
=
6624639107781167248L
;
}
static
WrapCopier
<
Wi
,
Application
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Application
.
class
,
null
,
FieldsUnmodifyIncludePorperties
);
}
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionEdit.java
浏览文件 @
db7406e5
...
...
@@ -12,49 +12,56 @@ import com.x.base.core.project.cache.CacheManager;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.assemble.designer.MessageFactory
;
import
com.x.processplatform.core.entity.element.Application
;
class
ActionEdit
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
emc
.
beginTransaction
(
Application
.
class
);
Application
application
=
emc
.
find
(
id
,
Application
.
class
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
id
);
}
if
(!
business
.
editable
(
effectivePerson
,
application
))
{
throw
new
ExceptionInsufficientPermission
(
effectivePerson
.
getDistinguishedName
());
}
Wi
.
copier
.
copy
(
wi
,
application
);
application
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdateTime
(
new
Date
());
emc
.
commit
();
CacheManager
.
notify
(
Application
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
application
.
getId
());
result
.
setData
(
wo
);
MessageFactory
.
application_update
(
application
);
return
result
;
}
}
public
static
class
Wo
extends
WoId
{
}
public
static
class
Wi
extends
Application
{
private
static
final
long
serialVersionUID
=
6624639107781167248L
;
static
WrapCopier
<
Wi
,
Application
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Application
.
class
,
null
,
JpaObject
.
FieldsUnmodifyIncludePorpertiesExcludeId
);
}
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionEdit
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
emc
.
beginTransaction
(
Application
.
class
);
Application
application
=
emc
.
find
(
id
,
Application
.
class
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
id
);
}
if
(!
business
.
editable
(
effectivePerson
,
application
))
{
throw
new
ExceptionInsufficientPermission
(
effectivePerson
.
getDistinguishedName
());
}
Wi
.
copier
.
copy
(
wi
,
application
);
application
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdateTime
(
new
Date
());
emc
.
commit
();
CacheManager
.
notify
(
Application
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
application
.
getId
());
result
.
setData
(
wo
);
MessageFactory
.
application_update
(
application
);
return
result
;
}
}
public
static
class
Wo
extends
WoId
{
}
public
static
class
Wi
extends
Application
{
private
static
final
long
serialVersionUID
=
6624639107781167248L
;
static
WrapCopier
<
Wi
,
Application
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Application
.
class
,
null
,
JpaObject
.
FieldsUnmodifyIncludePorpertiesExcludeId
);
}
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/input/ActionCreate.java
浏览文件 @
db7406e5
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录