Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
5b489514
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
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,发现更多精彩内容 >>
提交
5b489514
编写于
7月 18, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update delete work
上级
ba9cb3de
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
170 addition
and
55 deletion
+170
-55
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Person.java
.../src/main/java/com/x/base/core/project/config/Person.java
+54
-46
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java
...com/x/processplatform/core/entity/content/Attachment.java
+2
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionDelete.java
...splatform/service/processing/jaxrs/work/ActionDelete.java
+1
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/BaseAction.java
...essplatform/service/processing/jaxrs/work/BaseAction.java
+113
-6
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Person.java
浏览文件 @
5b489514
package
com.x.base.core.project.config
;
import
java.io.File
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -133,6 +135,12 @@ public class Person extends ConfigObject {
@FieldDescribe
(
"是否启用安全注销."
)
private
Boolean
enableSafeLogout
;
@FieldDescribe
(
"扩展设置."
)
private
Map
<
String
,
Object
>
extension
;
public
Map
<
String
,
Object
>
getExtension
()
{
return
null
==
this
.
extension
?
new
LinkedHashMap
<>()
:
this
.
extension
;
}
public
Boolean
getEnableSafeLogout
()
{
return
BooleanUtils
.
isTrue
(
this
.
enableSafeLogout
);
...
...
@@ -379,50 +387,50 @@ public class Person extends ConfigObject {
this
.
enableSafeLogout
=
enableSafeLogout
;
}
public
static
class
Maintainer
extends
ConfigObject
{
private
static
final
long
serialVersionUID
=
9067834464099067485L
;
public
static
final
Boolean
DEFAULT_ENABLE
=
false
;
public
static
final
String
DEFAULT_NAME
=
""
;
public
static
final
String
DEFAULT_UNIT
=
""
;
public
static
final
String
DEFAULT_MOBILE
=
""
;
public
static
Maintainer
defaultInstance
()
{
return
new
Maintainer
();
}
public
Maintainer
()
{
this
.
enable
=
DEFAULT_ENABLE
;
this
.
name
=
DEFAULT_NAME
;
this
.
unit
=
DEFAULT_UNIT
;
this
.
mobile
=
DEFAULT_MOBILE
;
}
@FieldDescribe
(
"是否启用"
)
private
Boolean
enable
;
@FieldDescribe
(
"维护者姓名"
)
private
String
name
;
@FieldDescribe
(
"组织"
)
private
String
unit
;
@FieldDescribe
(
"手机号"
)
private
String
mobile
;
public
Boolean
getEnable
()
{
return
BooleanUtils
.
isTrue
(
enable
);
}
public
String
getName
()
{
return
StringUtils
.
isEmpty
(
this
.
name
)
?
DEFAULT_NAME
:
this
.
name
;
}
public
String
getUnit
()
{
return
StringUtils
.
isEmpty
(
this
.
unit
)
?
DEFAULT_UNIT
:
this
.
unit
;
}
public
String
getMobile
()
{
return
StringUtils
.
isEmpty
(
this
.
mobile
)
?
DEFAULT_MOBILE
:
this
.
mobile
;
}
}
//
public static class Maintainer extends ConfigObject {
//
//
private static final long serialVersionUID = 9067834464099067485L;
//
//
public static final Boolean DEFAULT_ENABLE = false;
//
public static final String DEFAULT_NAME = "";
//
public static final String DEFAULT_UNIT = "";
//
public static final String DEFAULT_MOBILE = "";
//
//
public static Maintainer defaultInstance() {
//
return new Maintainer();
//
}
//
//
public Maintainer() {
//
this.enable = DEFAULT_ENABLE;
//
this.name = DEFAULT_NAME;
//
this.unit = DEFAULT_UNIT;
//
this.mobile = DEFAULT_MOBILE;
//
}
//
//
@FieldDescribe("是否启用")
//
private Boolean enable;
//
@FieldDescribe("维护者姓名")
//
private String name;
//
@FieldDescribe("组织")
//
private String unit;
//
@FieldDescribe("手机号")
//
private String mobile;
//
//
public Boolean getEnable() {
//
return BooleanUtils.isTrue(enable);
//
}
//
//
public String getName() {
//
return StringUtils.isEmpty(this.name) ? DEFAULT_NAME : this.name;
//
}
//
//
public String getUnit() {
//
return StringUtils.isEmpty(this.unit) ? DEFAULT_UNIT : this.unit;
//
}
//
//
public String getMobile() {
//
return StringUtils.isEmpty(this.mobile) ? DEFAULT_MOBILE : this.mobile;
//
}
//
//
}
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java
浏览文件 @
5b489514
...
...
@@ -310,10 +310,10 @@ public class Attachment extends StorageObject {
private
String
lastUpdatePerson
;
public
static
final
String
activity_FIELDNAME
=
"activity"
;
@FieldDescribe
(
"活动
ID
."
)
@FieldDescribe
(
"活动
标识,可以为空,在给已完成工作添加附件时值为空
."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
activity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activity_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
fals
e
)
@CheckPersist
(
allowEmpty
=
tru
e
)
private
String
activity
;
public
static
final
String
activityName_FIELDNAME
=
"activityName"
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionDelete.java
浏览文件 @
5b489514
...
...
@@ -23,7 +23,7 @@ import com.x.processplatform.service.processing.Business;
*/
class
ActionDelete
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Action
CreateSerial
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Action
Delete
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/BaseAction.java
浏览文件 @
5b489514
package
com.x.processplatform.service.processing.jaxrs.work
;
import
java.util.Comparator
;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.dataitem.DataItem
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.DocSign
;
...
...
@@ -27,6 +33,8 @@ import com.x.query.core.entity.Item;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
BaseAction
.
class
);
protected
boolean
cascadeDeleteWorkBeginButNotCommit
(
Business
business
,
Work
work
)
throws
Exception
{
if
(
business
.
work
().
listWithJob
(
work
.
getJob
()).
size
()
>
1
)
{
List
<
String
>
taskIds
=
business
.
entityManagerContainer
().
idsEqual
(
Task
.
class
,
Task
.
work_FIELDNAME
,
...
...
@@ -38,6 +46,13 @@ abstract class BaseAction extends StandardJaxrsAction {
MessageFactory
.
task_delete
(
o
);
}
}
Work
mergeTo
=
this
.
findWorkMergeTo
(
business
,
work
);
this
.
mergeTaskCompleted
(
business
,
work
,
mergeTo
);
this
.
mergeRead
(
business
,
work
,
mergeTo
);
this
.
mergeReadCompleted
(
business
,
work
,
mergeTo
);
this
.
mergeReview
(
business
,
work
,
mergeTo
);
this
.
mergeAttachment
(
business
,
work
,
mergeTo
);
this
.
mergeWorkLog
(
business
,
work
,
mergeTo
);
business
.
entityManagerContainer
().
beginTransaction
(
Work
.
class
);
business
.
entityManagerContainer
().
remove
(
work
,
CheckRemoveType
.
all
);
return
false
;
...
...
@@ -141,7 +156,7 @@ abstract class BaseAction extends StandardJaxrsAction {
}
private
void
deleteItem
(
Business
business
,
String
job
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
Item
.
class
,
Item
.
bundle_FIELDNAME
,
job
);
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
Item
.
class
,
Data
Item
.
bundle_FIELDNAME
,
job
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
business
.
entityManagerContainer
().
beginTransaction
(
Item
.
class
);
business
.
entityManagerContainer
().
delete
(
Item
.
class
,
ids
);
...
...
@@ -151,7 +166,7 @@ abstract class BaseAction extends StandardJaxrsAction {
private
void
deleteWork
(
Business
business
,
Work
work
)
throws
Exception
{
business
.
entityManagerContainer
().
beginTransaction
(
Work
.
class
);
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqualAndNotEqual
(
Work
.
class
,
Work
.
job_FIELDNAME
,
work
.
getJob
(),
Work
.
id_FIELDNAME
,
work
.
getId
());
work
.
getJob
(),
JpaObject
.
id_FIELDNAME
,
work
.
getId
());
if
(
ListTools
.
isNotEmpty
(
ids
))
{
for
(
Work
o
:
business
.
entityManagerContainer
().
list
(
Work
.
class
,
ids
))
{
business
.
entityManagerContainer
().
remove
(
o
);
...
...
@@ -179,7 +194,7 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
pr
otected
void
deleteSign
(
Business
business
,
String
job
)
throws
Exception
{
pr
ivate
void
deleteSign
(
Business
business
,
String
job
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
DocSign
.
class
,
DocSign
.
job_FIELDNAME
,
job
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
business
.
entityManagerContainer
().
beginTransaction
(
DocSign
.
class
);
...
...
@@ -187,15 +202,16 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
protected
void
deleteSignScrawl
(
Business
business
,
String
job
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
DocSignScrawl
.
class
,
DocSignScrawl
.
job_FIELDNAME
,
job
);
private
void
deleteSignScrawl
(
Business
business
,
String
job
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
DocSignScrawl
.
class
,
DocSignScrawl
.
job_FIELDNAME
,
job
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
business
.
entityManagerContainer
().
beginTransaction
(
DocSignScrawl
.
class
);
DocSignScrawl
obj
;
for
(
String
id
:
ids
)
{
obj
=
business
.
entityManagerContainer
().
find
(
id
,
DocSignScrawl
.
class
);
if
(
null
!=
obj
)
{
if
(
StringUtils
.
isNotBlank
(
obj
.
getStorage
()))
{
if
(
StringUtils
.
isNotBlank
(
obj
.
getStorage
()))
{
StorageMapping
mapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
DocSignScrawl
.
class
,
obj
.
getStorage
());
if
(
null
!=
mapping
)
{
...
...
@@ -208,4 +224,95 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
private
Work
findWorkMergeTo
(
Business
business
,
Work
work
)
throws
Exception
{
List
<
Work
>
works
=
business
.
entityManagerContainer
().
listEqual
(
Work
.
class
,
Work
.
job_FIELDNAME
,
work
.
getJob
());
// 查找同级
Work
merge
=
works
.
stream
()
.
filter
(
o
->
(
o
!=
work
)
&&
StringUtils
.
equalsIgnoreCase
(
work
.
getSplitToken
(),
o
.
getSplitToken
()))
.
sorted
(
Comparator
.
comparing
(
Work:
:
getCreateTime
,
Comparator
.
nullsLast
(
Comparator
.
reverseOrder
())))
.
findFirst
().
orElse
(
null
);
// 找不到同级那么开始早更深层次的文档
if
(
null
==
merge
)
{
merge
=
works
.
stream
().
filter
(
o
->
((
o
!=
work
)
&&
BooleanUtils
.
isTrue
(
o
.
getSplitting
())
&&
o
.
getSplitTokenList
().
contains
(
work
.
getSplitToken
()))).
sorted
((
o1
,
o2
)
->
{
int
compare
=
o2
.
getSplitTokenList
().
size
()
-
o1
.
getSplitTokenList
().
size
();
if
(
compare
==
0
)
{
return
o2
.
getCreateTime
().
compareTo
(
o1
.
getCreateTime
());
}
return
compare
;
}).
findFirst
().
orElse
(
null
);
}
// 最后找除去本身之外最新的工作
if
(
null
==
merge
)
{
merge
=
works
.
stream
().
filter
(
o
->
o
!=
work
)
.
sorted
(
Comparator
.
comparing
(
Work:
:
getCreateTime
,
Comparator
.
nullsLast
(
Comparator
.
reverseOrder
())))
.
findFirst
().
orElse
(
null
);
}
return
merge
;
}
private
void
mergeTaskCompleted
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
TaskCompleted
.
class
);
business
.
entityManagerContainer
().
listEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
work_FIELDNAME
,
work
.
getId
())
.
forEach
(
o
->
{
o
.
setWork
(
mergeTo
.
getId
());
});
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
private
void
mergeRead
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
Read
.
class
);
business
.
entityManagerContainer
().
listEqual
(
Read
.
class
,
Read
.
work_FIELDNAME
,
work
.
getId
())
.
forEach
(
o
->
o
.
setWork
(
mergeTo
.
getId
()));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
private
void
mergeReadCompleted
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
ReadCompleted
.
class
);
business
.
entityManagerContainer
().
listEqual
(
ReadCompleted
.
class
,
ReadCompleted
.
work_FIELDNAME
,
work
.
getId
())
.
forEach
(
o
->
o
.
setWork
(
mergeTo
.
getId
()));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
private
void
mergeReview
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
Review
.
class
);
business
.
entityManagerContainer
().
listEqual
(
Review
.
class
,
Review
.
work_FIELDNAME
,
work
.
getId
())
.
forEach
(
o
->
o
.
setWork
(
mergeTo
.
getId
()));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
private
void
mergeAttachment
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
Attachment
.
class
);
business
.
entityManagerContainer
().
listEqual
(
Attachment
.
class
,
Attachment
.
work_FIELDNAME
,
work
.
getId
())
.
forEach
(
o
->
o
.
setWork
(
mergeTo
.
getId
()));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
private
void
mergeWorkLog
(
Business
business
,
Work
work
,
Work
mergeTo
)
{
try
{
business
.
entityManagerContainer
().
beginTransaction
(
WorkLog
.
class
);
business
.
entityManagerContainer
()
.
listEqual
(
WorkLog
.
class
,
WorkLog
.
ARRIVEDACTIVITYTOKEN_FIELDNAME
,
work
.
getActivityToken
())
.
forEach
(
o
->
o
.
setWork
(
mergeTo
.
getId
()));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录