rev:更新流程实例

This commit is contained in:
2024-05-11 14:16:44 +08:00
parent ed91c89d4e
commit ccc198352a
6 changed files with 97 additions and 20 deletions

View File

@@ -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);
}
}

View File

@@ -45,6 +45,9 @@ public class ActRuExecution implements Serializable {
*/
private String deployment_id;
@TableField(exist = false)
private String deployment_name;
/**
* 当前实例执行节点id
*/

View File

@@ -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);
}

View File

@@ -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