Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jfV5lcyq
Overview
Overview
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
管理员
jfV5lcyq
Commits
9bc06c27
Commit
9bc06c27
authored
Jul 27, 2018
by
罗绍泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程引擎简单回退功能实现
parent
32302264
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
199 additions
and
163 deletions
+199
-163
procinstanceTabHistory.js
...t/process/pages/procinstance/js/procinstanceTabHistory.js
+12
-4
proctaskTab.js
WebContent/process/pages/proctask/js/proctaskTab.js
+7
-0
NodeJumpTaskCmd.java
src_process/com/gaowj/activiti/cmd/NodeJumpTaskCmd.java
+69
-0
AssignmentTaskListener.java
...s/com/gaowj/activiti/listener/AssignmentTaskListener.java
+1
-3
ProcinstanceBusinessImpl.java
...gaowj/business/procinstance/ProcinstanceBusinessImpl.java
+5
-9
ProctaskBusinessImpl.java
...ess/com/gaowj/business/proctask/ProctaskBusinessImpl.java
+10
-141
ActivitiTools.java
src_process/com/gaowj/business/utils/ActivitiTools.java
+0
-0
ActivitiOptEnum.java
...ocess/com/gaowj/business/utils/model/ActivitiOptEnum.java
+77
-0
ActivitiResultEnum.java
...ss/com/gaowj/business/utils/model/ActivitiResultEnum.java
+5
-1
dataAction.java
src_process/com/gaowj/procinstance/action/dataAction.java
+4
-4
actAction.java
src_process/com/gaowj/proctask/action/actAction.java
+9
-1
No files found.
WebContent/process/pages/procinstance/js/procinstanceTabHistory.js
View file @
9bc06c27
...
@@ -15,22 +15,30 @@ $(function(){
...
@@ -15,22 +15,30 @@ $(function(){
field
:
'ACTIVITY_NAME'
,
field
:
'ACTIVITY_NAME'
,
title
:
'环节名称'
,
title
:
'环节名称'
,
width
:
200
,
width
:
200
,
align
:
'center'
,
align
:
'center'
},
{
},
{
field
:
'ASSIGNEE'
,
field
:
'ASSIGNEE'
,
title
:
'办理人'
,
title
:
'办理人'
,
width
:
200
,
width
:
200
,
align
:
'center'
,
align
:
'center'
// }, {
// field : 'IS_BACK',
// title : '特殊',
// width : 250,
// align : 'center',
// formatter:function(value,row,index){
// return value==1?"回退":"正常";
// }
},
{
},
{
field
:
'START_TIME'
,
field
:
'START_TIME'
,
title
:
'开始时间'
,
title
:
'开始时间'
,
width
:
250
,
width
:
250
,
align
:
'center'
,
align
:
'center'
},
{
},
{
field
:
'END_TIME'
,
field
:
'END_TIME'
,
title
:
'结束时间'
,
title
:
'结束时间'
,
width
:
250
,
width
:
250
,
align
:
'center'
,
align
:
'center'
}
]
],
}
]
],
onLoadSuccess
:
function
()
{
onLoadSuccess
:
function
()
{
if
(
is_opetipmenuwidth
==
null
){
if
(
is_opetipmenuwidth
==
null
){
...
...
WebContent/process/pages/proctask/js/proctaskTab.js
View file @
9bc06c27
...
@@ -178,6 +178,13 @@ function updateDataToNext(is_entity){
...
@@ -178,6 +178,13 @@ function updateDataToNext(is_entity){
return
v_result
;
return
v_result
;
}
}
//退回按钮执行事件
function
backProc
(
is_entity
){
v_result
=
proctaskModule
.
act
.
back
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
/****/
/****/
/**
/**
...
...
src_process/com/gaowj/activiti/cmd/NodeJumpTaskCmd.java
0 → 100644
View file @
9bc06c27
package
com
.
gaowj
.
activiti
.
cmd
;
import
java.util.Iterator
;
import
java.util.Map
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.persistence.entity.ExecutionEntity
;
import
org.activiti.engine.impl.persistence.entity.ExecutionEntityManager
;
import
org.activiti.engine.impl.persistence.entity.TaskEntity
;
import
org.activiti.engine.impl.pvm.process.ActivityImpl
;
public
class
NodeJumpTaskCmd
implements
Command
<
Void
>
{
protected
String
executionId
;
// 执行ID
protected
ActivityImpl
desActivity
;
// 目标引擎对象
protected
Map
<
String
,
Object
>
paramvar
;
// 变量
protected
ActivityImpl
currentActivity
;
// 当前引擎对象
protected
String
deleteReason
=
"completed"
;
/**
* 构造参数 可以根据自己的业务需要添加更多的字段
*
* @param executionId
* @param desActivity
* @param paramvar
* @param currentActivity
*/
public
NodeJumpTaskCmd
(
String
executionId
,
ActivityImpl
desActivity
,
Map
<
String
,
Object
>
paramvar
,
ActivityImpl
currentActivity
)
{
this
.
executionId
=
executionId
;
this
.
desActivity
=
desActivity
;
this
.
paramvar
=
paramvar
;
this
.
currentActivity
=
currentActivity
;
}
public
NodeJumpTaskCmd
(
String
executionId
,
ActivityImpl
desActivity
,
Map
<
String
,
Object
>
paramvar
,
ActivityImpl
currentActivity
,
String
deleteReason
)
{
this
.
executionId
=
executionId
;
this
.
desActivity
=
desActivity
;
this
.
paramvar
=
paramvar
;
this
.
currentActivity
=
currentActivity
;
this
.
deleteReason
=
deleteReason
;
}
/**
* 获取执行实体管理 获取当前的任务执行对象 设置对应的值 获取当前的任务 删除 执行目标工作流
*/
@Override
public
Void
execute
(
CommandContext
commandContext
)
{
// 获取执行实体管理
ExecutionEntityManager
executionEntityManager
=
commandContext
.
getExecutionEntityManager
();
// 根据ExecutionID 查找执行实体 获取当前流程的executionId,因为在并发的情况下executionId是唯一的。
ExecutionEntity
executionEntity
=
executionEntityManager
.
findExecutionById
(
executionId
);
executionEntity
.
setVariables
(
paramvar
);
executionEntity
.
setEventSource
(
this
.
currentActivity
);
executionEntity
.
setActivity
(
this
.
currentActivity
);
// 获取当前ExecutionID的任务 根据executionId 获取Task
Iterator
<
TaskEntity
>
localIterator
=
commandContext
.
getTaskEntityManager
().
findTasksByExecutionId
(
this
.
executionId
).
iterator
();
while
(
localIterator
.
hasNext
())
{
TaskEntity
taskEntity
=
(
TaskEntity
)
localIterator
.
next
();
// 触发任务监听
taskEntity
.
fireEvent
(
"complete"
);
// 删除任务的原因
commandContext
.
getTaskEntityManager
().
deleteTask
(
taskEntity
,
this
.
deleteReason
,
false
);
}
executionEntity
.
executeActivity
(
this
.
desActivity
);
System
.
out
.
println
();
return
null
;
}
}
src_process/com/gaowj/activiti/listener/AssignmentTaskListener.java
View file @
9bc06c27
...
@@ -9,13 +9,11 @@ import org.activiti.engine.HistoryService;
...
@@ -9,13 +9,11 @@ import org.activiti.engine.HistoryService;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.delegate.TaskListener
;
import
org.activiti.engine.delegate.TaskListener
;
import
org.activiti.engine.history.HistoricActivityInstance
;
import
org.activiti.engine.history.HistoricActivityInstance
;
import
org.activiti.engine.task.IdentityLink
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.web.context.ContextLoaderListener
;
import
org.springframework.web.context.ContextLoaderListener
;
import
org.springframework.web.context.support.WebApplicationContextUtils
;
import
com.gaowj.business.ProcdefiChooseUserBusiness
;
import
com.gaowj.business.ProcdefiChooseUserBusiness
;
import
com.gaowj.business.ProcinstanceBusiness
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.util.SessionUtil
;
/**
/**
...
...
src_process/com/gaowj/business/procinstance/ProcinstanceBusinessImpl.java
View file @
9bc06c27
...
@@ -20,6 +20,7 @@ import org.activiti.engine.TaskService;
...
@@ -20,6 +20,7 @@ import org.activiti.engine.TaskService;
import
org.activiti.engine.history.HistoricActivityInstance
;
import
org.activiti.engine.history.HistoricActivityInstance
;
import
org.activiti.engine.history.HistoricProcessInstance
;
import
org.activiti.engine.history.HistoricProcessInstance
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.task.Task
;
import
org.activiti.image.impl.DefaultProcessDiagramGenerator
;
import
org.activiti.image.impl.DefaultProcessDiagramGenerator
;
import
org.apache.ibatis.session.RowBounds
;
import
org.apache.ibatis.session.RowBounds
;
...
@@ -32,6 +33,7 @@ import com.gaowj.business.system.SystemBackDAO;
...
@@ -32,6 +33,7 @@ import com.gaowj.business.system.SystemBackDAO;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.utils.ActivitiTools
;
import
com.gaowj.business.utils.ActivitiTools
;
import
com.gaowj.business.utils.model.ActivitiOptEnum
;
import
com.gaowj.business.utils.model.ActivitiResultEnum
;
import
com.gaowj.business.utils.model.ActivitiResultEnum
;
public
class
ProcinstanceBusinessImpl
implements
ProcinstanceBusiness
{
public
class
ProcinstanceBusinessImpl
implements
ProcinstanceBusiness
{
...
@@ -157,7 +159,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
...
@@ -157,7 +159,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
@Override
@Override
public
Map
<
String
,
Object
>
update_proc_instance
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
public
Map
<
String
,
Object
>
update_proc_instance
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
false
);
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
ActivitiOptEnum
.
SAVE
);
switch
(
activitiResultEnum
)
{
switch
(
activitiResultEnum
)
{
case
OK:
case
OK:
break
;
break
;
...
@@ -169,7 +171,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
...
@@ -169,7 +171,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
@Override
@Override
public
Map
<
String
,
Object
>
update_proc_instance_next
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
public
Map
<
String
,
Object
>
update_proc_instance_next
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
true
);
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
ActivitiOptEnum
.
SAVE_AND_NEXT
);
switch
(
activitiResultEnum
)
{
switch
(
activitiResultEnum
)
{
case
OK:
case
OK:
break
;
break
;
...
@@ -289,13 +291,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
...
@@ -289,13 +291,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
// 只显示userTask类型
// 只显示userTask类型
continue
;
continue
;
}
}
/*
* if(hai.getActivityName()==null){ continue; }
*/
/*
* if(hai.getAssignee()==null&&hai.getEndTime()!=null){
* //如果没有办理人,但是有结束时间,任务该环节是开始环节,默认剔除 continue; }
*/
if
(
hai
.
getAssignee
()
!=
null
)
{
if
(
hai
.
getAssignee
()
!=
null
)
{
listAssignee
.
add
(
hai
.
getAssignee
());
listAssignee
.
add
(
hai
.
getAssignee
());
}
}
...
...
src_process/com/gaowj/business/proctask/ProctaskBusinessImpl.java
View file @
9bc06c27
...
@@ -32,6 +32,7 @@ import com.gaowj.business.procinstance.procinstanceDAO;
...
@@ -32,6 +32,7 @@ import com.gaowj.business.procinstance.procinstanceDAO;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.utils.ActivitiTools
;
import
com.gaowj.business.utils.ActivitiTools
;
import
com.gaowj.business.utils.model.ActivitiOptEnum
;
import
com.gaowj.business.utils.model.ActivitiResultEnum
;
import
com.gaowj.business.utils.model.ActivitiResultEnum
;
public
class
ProctaskBusinessImpl
implements
ProctaskBusiness
{
public
class
ProctaskBusinessImpl
implements
ProctaskBusiness
{
...
@@ -232,7 +233,7 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
...
@@ -232,7 +233,7 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
@Override
@Override
public
Map
<
String
,
Object
>
update
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
public
Map
<
String
,
Object
>
update
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
false
);
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
ActivitiOptEnum
.
SAVE
);
switch
(
activitiResultEnum
)
{
switch
(
activitiResultEnum
)
{
case
OK:
case
OK:
break
;
break
;
...
@@ -244,7 +245,7 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
...
@@ -244,7 +245,7 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
@Override
@Override
public
Map
<
String
,
Object
>
updateToNext
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
public
Map
<
String
,
Object
>
updateToNext
(
Map
<
String
,
Object
>
entity
)
throws
ActivitiException
,
BusinessException
{
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
true
);
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
ActivitiOptEnum
.
SAVE_AND_NEXT
);
switch
(
activitiResultEnum
)
{
switch
(
activitiResultEnum
)
{
case
OK:
case
OK:
break
;
break
;
...
@@ -256,147 +257,15 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
...
@@ -256,147 +257,15 @@ public class ProctaskBusinessImpl implements ProctaskBusiness {
@Override
@Override
public
Map
<
String
,
Object
>
back
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
{
public
Map
<
String
,
Object
>
back
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
{
// 存储自定义表单的业务数据
ActivitiResultEnum
activitiResultEnum
=
ActivitiTools
.
save
(
entity
,
ActivitiOptEnum
.
SAVE_AND_RALLBACK
);
update_custom_business
(
entity
.
get
(
"TABLE_ID_SYSTEM"
).
toString
(),
entity
);
switch
(
activitiResultEnum
)
{
// 通过任务id获取流程id
case
OK:
String
taskId
=
entity
.
get
(
"TASK_ID_SYSTEM"
).
toString
();
break
;
// 退回当前任务
default
:
taskRollBack
(
taskId
);
throw
new
ActivitiException
(
activitiResultEnum
.
getMsg
());
return
entity
;
}
private
void
update_proc_instance
(
Map
<
String
,
Object
>
entity
)
{
Map
<
String
,
Object
>
entity2
=
new
HashMap
<
String
,
Object
>();
entity2
.
put
(
"UUID"
,
entity
.
get
(
"UUID"
));
if
(
entity
.
keySet
()
!=
null
)
{
List
<
Map
<
String
,
Object
>>
info
=
new
ArrayList
<
Map
<
String
,
Object
>>();
entity2
.
put
(
"info"
,
info
);
Set
<
String
>
key
=
entity
.
keySet
();
for
(
String
str
:
key
)
{
if
(
"UUID"
.
equals
(
str
))
{
continue
;
}
Map
<
String
,
Object
>
colum
=
new
HashMap
<
String
,
Object
>();
colum
.
put
(
"key"
,
str
);
colum
.
put
(
"value"
,
entity
.
get
(
str
));
info
.
add
(
colum
);
}
}
procinstanceDAO
.
update_proc_instance
(
entity2
);
}
private
String
update_custom_business
(
String
tableId
,
Map
<
String
,
Object
>
entity
)
{
entity
.
remove
(
"TABLE_ID_SYSTEM"
);
if
(
entity
.
get
(
"UUID"
)
==
null
)
{
entity
.
put
(
"UUID"
,
java
.
util
.
UUID
.
randomUUID
().
toString
());
}
if
(
entity
.
get
(
"CREATE_TIME"
)
==
null
)
{
entity
.
put
(
"CREATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"CREATE_ID"
)
==
null
)
{
entity
.
put
(
"CREATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
}
Map
<
String
,
Object
>
query
=
new
HashMap
<
String
,
Object
>();
return
entity
;
query
.
put
(
"UUID"
,
tableId
);
// 动态传值插入
List
<
Map
<
String
,
Object
>>
infoList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
// List<String> infoListKey = new ArrayList<String>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
// UUID不需要加进去
if
(
"UUID"
.
equals
(
str
))
{
continue
;
}
Map
<
String
,
Object
>
kv
=
new
HashMap
<
String
,
Object
>();
kv
.
put
(
"value"
,
entity
.
get
(
str
));
kv
.
put
(
"key"
,
str
);
infoList
.
add
(
kv
);
}
entity
.
put
(
"infoList"
,
infoList
);
}
/*
* List<Object> infoList = new ArrayList<Object>(); if (entity.keySet()
* != null) { Set<String> key = entity.keySet(); // 将map集合中的key和value
* 取出来分别放到list集合里 for (String str : key) {
* infoList.add(entity.get(str)); infoListKey.add(str); }
* entity.put("infoListKey", infoListKey); entity.put("infoList",
* infoList); }
*/
// 设置表名
String
tableName
=
formtableDAO
.
list_form_table
(
query
).
get
(
0
).
get
(
"TABLE_NAME"
).
toString
();
entity
.
put
(
"tableName"
,
tableName
);
entity
.
put
(
"uuid"
,
entity
.
get
(
"UUID"
));
procdefinitionDAO
.
update_custom_business
(
entity
);
return
entity
.
get
(
"UUID"
).
toString
();
}
}
private
void
taskRollBack
(
String
taskId
)
{
try
{
Map
<
String
,
Object
>
variables
;
// 取得当前任务
HistoricTaskInstance
currTask
=
historyService
.
createHistoricTaskInstanceQuery
().
taskId
(
taskId
).
singleResult
();
// 取得流程实例
ProcessInstance
instance
=
runtimeService
.
createProcessInstanceQuery
().
processInstanceId
(
currTask
.
getProcessInstanceId
()).
singleResult
();
if
(
instance
==
null
)
{
// 流程结束
}
variables
=
instance
.
getProcessVariables
();
// 取得流程定义
ProcessDefinitionEntity
definition
=
(
ProcessDefinitionEntity
)
(
repositoryService
.
getProcessDefinition
(
currTask
.
getProcessDefinitionId
()));
if
(
definition
==
null
)
{
// log.error("流程定义未找到");
return
;
}
// 取得上一步活动
ActivityImpl
currActivity
=
((
ProcessDefinitionImpl
)
definition
).
findActivity
(
currTask
.
getTaskDefinitionKey
());
List
<
PvmTransition
>
nextTransitionList
=
currActivity
.
getIncomingTransitions
();
// 清除当前活动的出口
List
<
PvmTransition
>
oriPvmTransitionList
=
new
ArrayList
<
PvmTransition
>();
List
<
PvmTransition
>
pvmTransitionList
=
currActivity
.
getOutgoingTransitions
();
for
(
PvmTransition
pvmTransition
:
pvmTransitionList
)
{
oriPvmTransitionList
.
add
(
pvmTransition
);
}
pvmTransitionList
.
clear
();
// 建立新出口
List
<
TransitionImpl
>
newTransitions
=
new
ArrayList
<
TransitionImpl
>();
for
(
PvmTransition
nextTransition
:
nextTransitionList
)
{
PvmActivity
nextActivity
=
nextTransition
.
getSource
();
ActivityImpl
nextActivityImpl
=
((
ProcessDefinitionImpl
)
definition
).
findActivity
(
nextActivity
.
getId
());
TransitionImpl
newTransition
=
currActivity
.
createOutgoingTransition
();
newTransition
.
setDestination
(
nextActivityImpl
);
newTransitions
.
add
(
newTransition
);
}
// 完成任务
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
instance
.
getId
()).
taskDefinitionKey
(
currTask
.
getTaskDefinitionKey
()).
list
();
for
(
Task
task
:
tasks
)
{
taskService
.
complete
(
task
.
getId
(),
variables
);
historyService
.
deleteHistoricTaskInstance
(
task
.
getId
());
}
// 恢复方向
for
(
TransitionImpl
transitionImpl
:
newTransitions
)
{
currActivity
.
getOutgoingTransitions
().
remove
(
transitionImpl
);
}
for
(
PvmTransition
pvmTransition
:
oriPvmTransitionList
)
{
pvmTransitionList
.
add
(
pvmTransition
);
}
return
;
}
catch
(
Exception
e
)
{
return
;
}
}
}
}
src_process/com/gaowj/business/utils/ActivitiTools.java
View file @
9bc06c27
This diff is collapsed.
Click to expand it.
src_process/com/gaowj/business/utils/model/ActivitiOptEnum.java
0 → 100644
View file @
9bc06c27
package
com
.
gaowj
.
business
.
utils
.
model
;
/**
* activiti操作枚举类
*
* @author luosz
*
*/
public
enum
ActivitiOptEnum
{
/**
* 保存
*/
SAVE
(
true
,
false
,
false
),
/**
* 保存并且下一步
*/
SAVE_AND_NEXT
(
true
,
true
,
false
),
/**
* 下一步
*/
NEXT
(
false
,
true
,
false
),
/**
* 回退
*/
RALLBACK
(
false
,
false
,
true
),
/**
* 保存并回退
*/
SAVE_AND_RALLBACK
(
true
,
false
,
true
);
private
boolean
isNextSign
=
false
;
private
boolean
isSaveSign
=
false
;
private
boolean
isRallbackSign
=
false
;
/**
* 操作规则制定
*
* @param isSaveSign
* 是否执行保存
* @param isNextSign
* 是否执行下一步
* @param isRallbackSign
* 是否执行回退
*/
private
ActivitiOptEnum
(
boolean
isSaveSign
,
boolean
isNextSign
,
boolean
isRallbackSign
)
{
this
.
isSaveSign
=
isSaveSign
;
this
.
isNextSign
=
isNextSign
;
this
.
isRallbackSign
=
isRallbackSign
;
}
/**
* 是否执行下一步
*
* @return
*/
public
boolean
isNext
()
{
return
isNextSign
;
}
/**
* 是否执行保存
*
* @return
*/
public
boolean
isSave
()
{
return
isSaveSign
;
}
/**
* 是否执行回退
*
* @return
*/
public
boolean
isRallback
()
{
return
isRallbackSign
;
}
}
src_process/com/gaowj/business/utils/model/ActivitiResultEnum.java
View file @
9bc06c27
...
@@ -14,7 +14,11 @@ public enum ActivitiResultEnum {
...
@@ -14,7 +14,11 @@ public enum ActivitiResultEnum {
/**
/**
* 无权限
* 无权限
*/
*/
NO_POWER
(-
1
,
"您不是当前环节操作人,无权限修改该内容!"
);
NO_POWER
(-
1
,
"您不是当前环节操作人,无权限修改该内容!"
),
/**
* 退回异常
*/
ROLLBACK_ERROR
(-
2
,
"回退异常!"
);
private
ActivitiResult
activitiResult
;
private
ActivitiResult
activitiResult
;
private
ActivitiResultEnum
(
int
code
,
String
msg
)
{
private
ActivitiResultEnum
(
int
code
,
String
msg
)
{
...
...
src_process/com/gaowj/procinstance/action/dataAction.java
View file @
9bc06c27
...
@@ -62,12 +62,12 @@ public class dataAction extends BasicAction{
...
@@ -62,12 +62,12 @@ public class dataAction extends BasicAction{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_proc_instance
(
page
No
,
pageSize
,
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_proc_instance
(
page
,
rows
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
rows
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
pageRows
.
getItems
()));
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
pageRows
.
getItems
()));
data
.
put
(
"pageNo"
,
page
No
);
data
.
put
(
"pageNo"
,
page
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageSize"
,
rows
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageRows
.
getCount
());
data
.
put
(
"total"
,
pageRows
.
getCount
());
...
...
src_process/com/gaowj/proctask/action/actAction.java
View file @
9bc06c27
...
@@ -92,8 +92,16 @@ public class actAction extends BasicAction {
...
@@ -92,8 +92,16 @@ public class actAction extends BasicAction {
jsonObject
=
new
JSONObject
();
jsonObject
=
new
JSONObject
();
try
{
try
{
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
// business.list_proc_task(pageNo, pageSize, query)
Map
<
String
,
Object
>
procinstance
=
business
.
back
(
entity
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"backInfo"
,
""
+
procinstance
,
"回退流程实例数据"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"CONTENT"
),
"procinstance"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
}
catch
(
ActivitiException
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
e
.
getMessage
()));
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
e
.
getMessage
()));
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
e
.
getMessage
()));
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
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