rev:更新流程实例
This commit is contained in:
@@ -93,4 +93,10 @@ public class ExecutionController {
|
||||
public ResponseEntity<Object> getDeploymentById(@PathVariable String id) {
|
||||
return new ResponseEntity<>(procdefService.getById(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/changePdfActive")
|
||||
public ResponseEntity<Object> changePdfActive(@Validated @RequestBody ActRuExecution dto) {
|
||||
executionService.updateById(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ public class ActRuExecution implements Serializable {
|
||||
*/
|
||||
private String deployment_id;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String deployment_name;
|
||||
|
||||
/**
|
||||
* 当前实例执行节点id
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.wms.flow_manage.flow.service.execution.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.mapper.ActRuExecutionMapper;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
@@ -27,6 +30,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper, ActRuExecution> implements IActRuExecutionService {
|
||||
|
||||
@Autowired
|
||||
private IActReProcdefService procdefService;
|
||||
|
||||
@Override
|
||||
public Object getAll(ExecutionQuery query, PageQuery page) {
|
||||
//判断是否存在子实例
|
||||
@@ -38,7 +44,17 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
||||
LambdaQueryWrapper<ActRuExecution> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActRuExecution::getParent_id, record.getProc_inst_id());
|
||||
List<ActRuExecution> list = this.list(lambdaQueryWrapper);
|
||||
ActReProcdef procdef = procdefService.getById(record.getDeployment_id());
|
||||
if (ObjectUtil.isNotEmpty(procdef)){
|
||||
record.setDeployment_name(procdef.getName());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
for (ActRuExecution execution : list) {
|
||||
ActReProcdef procdefChildren = procdefService.getById(execution.getDeployment_id());
|
||||
if (ObjectUtil.isNotEmpty(procdefChildren)){
|
||||
execution.setDeployment_name(procdefChildren.getName());
|
||||
}
|
||||
}
|
||||
record.setHasChildren(true);
|
||||
record.setChildren(list);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:password}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -68,4 +68,23 @@ export function getDeploymentById(id) {
|
||||
})
|
||||
}
|
||||
|
||||
export default {add, edit, del, getTypes, getTaskTypes, getStrategyList, publish, queryByParentId, getDeploymentById}
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/bpmnExecution/changePdfActive',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
getTypes,
|
||||
getTaskTypes,
|
||||
getStrategyList,
|
||||
publish,
|
||||
queryByParentId,
|
||||
getDeploymentById,
|
||||
changeActive
|
||||
}
|
||||
|
||||
@@ -64,17 +64,43 @@
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="proc_inst_id" label="当前流程"/>
|
||||
<el-table-column prop="parent_id" label="父流程"/>
|
||||
<el-table-column prop="deployment_id" label="当前实例版本"/>
|
||||
<el-table-column prop="activity_id" label="当前实例节点"/>
|
||||
<el-table-column prop="activity_name" label="当前实例节点名称"/>
|
||||
<el-table-column prop="is_active" label="启用"/>
|
||||
<el-table-column prop="status" label="实例状态"/>
|
||||
<el-table-column prop="proc_inst_id" show-overflow-tooltip show-tooltip-when-overflow width="200" label="流程标识"/>
|
||||
<el-table-column prop="parent_id" width="200" label="父流程"/>
|
||||
<el-table-column v-if="false" prop="deployment_id" label="当前实例标识"/>
|
||||
<el-table-column prop="deployment_name" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
label="当前实例名称"/>
|
||||
<el-table-column v-if="false" prop="activity_id" label="当前实例节点"/>
|
||||
<el-table-column prop="activity_name" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
label="当前实例节点名称"/>
|
||||
<el-table-column prop="is_active" label="启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_active"
|
||||
active-color="#13ce66"
|
||||
:active-value=true
|
||||
:inactive-value=false
|
||||
@change="changeActive(scope.row)"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="实例状态">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
v-for="(item, index) in statusList"
|
||||
:key="index"
|
||||
:value="item.value"
|
||||
v-if="scope.row.status == item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" show-overflow-tooltip show-tooltip-when-overflow label="备注"/>
|
||||
<el-table-column prop="form_id" label="业务主键"/>
|
||||
<el-table-column prop="form_type" label="业务类型"/>
|
||||
<el-table-column prop="form_data" show-overflow-tooltip show-tooltip-when-overflow label="业务数据"/>
|
||||
<el-table-column prop="form_id" show-overflow-tooltip show-tooltip-when-overflow width="130" label="业务主键"/>
|
||||
<el-table-column prop="form_type" show-overflow-tooltip show-tooltip-when-overflow width="130" label="业务类型"/>
|
||||
<el-table-column prop="form_data" show-overflow-tooltip show-tooltip-when-overflow width="130"
|
||||
show-overflow-tooltip show-tooltip-when-overflow label="业务数据"/>
|
||||
<el-table-column prop="create_id" label="创建人" width="135"/>
|
||||
<el-table-column prop="create_time" label="创建时间" width="135"/>
|
||||
<el-table-column prop="update_time" label="修改时间" width="135"/>
|
||||
@@ -149,6 +175,16 @@ export default {
|
||||
formTypes: [],
|
||||
permission: {},
|
||||
modelJson: '',
|
||||
statusList: [
|
||||
{
|
||||
value: "30",
|
||||
label: "未知"
|
||||
},
|
||||
{
|
||||
value: "20",
|
||||
label: "未知"
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
@@ -165,20 +201,17 @@ export default {
|
||||
},
|
||||
viewClick(row) {
|
||||
curdExecution.getDeploymentById(row.deployment_id).then(res => {
|
||||
this.$refs.viewCurrentFlowDesigner.showLogicFlowDesigner(res.model_editor_json,row);
|
||||
this.$refs.viewCurrentFlowDesigner.showLogicFlowDesigner(res.model_editor_json, row);
|
||||
})
|
||||
},
|
||||
//logicflow怎么设置当前节点的颜色
|
||||
load(tree, treeNode, resolve) {
|
||||
console.log(tree)
|
||||
console.log(treeNode)
|
||||
setTimeout(() => {
|
||||
curdExecution.queryByParentId(tree.proc_inst_id).then(res => {
|
||||
console.log(res)
|
||||
resolve(res)
|
||||
})
|
||||
resolve(tree.children)
|
||||
}, 100)
|
||||
},
|
||||
changeActive(row) {
|
||||
curdExecution.changeActive(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user