增加参数查询

This commit is contained in:
pengjie 2024-12-16 17:00:53 +08:00
parent 14b3c88d57
commit 7596e473c8
3 changed files with 7 additions and 5 deletions

View File

@ -73,7 +73,7 @@ public class ProcessInstanceController {
@RequestParam(required = false) String fieldId, @RequestParam(required = false) String fieldId,
@RequestParam(required = false) String fieldVal, @RequestParam(required = false) String fieldVal,
@RequestParam(required = false) String key) { @RequestParam(required = false) String key) {
return R.ok(processService.getUserSubmittedList(pageSize, pageNo, UserUtil.getLoginUserId(), code, return R.ok(processService.getUserSubmittedList(pageSize, pageNo, UserUtil.getLoginUserId(), null, code,
finished, startTimes, keyword, fieldId, fieldVal, key)); finished, startTimes, keyword, fieldId, fieldVal, key));
} }
@ -96,8 +96,9 @@ public class ProcessInstanceController {
@RequestParam(required = false) String fieldId, @RequestParam(required = false) String fieldId,
@RequestParam(required = false) String fieldVal, @RequestParam(required = false) String fieldVal,
@RequestParam(required = false) String startUser, @RequestParam(required = false) String startUser,
@RequestParam(required = false) String key) { @RequestParam(required = false) String key,
return R.ok(processService.getUserSubmittedList(pageSize, pageNo, startUser, code, @RequestParam(required = false) String processInstanceId) {
return R.ok(processService.getUserSubmittedList(pageSize, pageNo, processInstanceId, startUser, code,
finished, startTimes, keyword, fieldId, fieldVal, key)); finished, startTimes, keyword, fieldId, fieldVal, key));
} }

View File

@ -23,7 +23,7 @@ public interface ProcessInstanceService {
List<Task> getProcessInstanceTaskList(String instanceId); List<Task> getProcessInstanceTaskList(String instanceId);
Page<ProcessInstanceVo> getUserSubmittedList(Integer pageSize, Integer pageNo, String startUser, String code, Page<ProcessInstanceVo> getUserSubmittedList(Integer pageSize, Integer pageNo, String processInstanceId, String startUser, String code,
Boolean finished, String[] startTimes, String keyword, Boolean finished, String[] startTimes, String keyword,
String fieldId, String fieldVal, String key); String fieldId, String fieldVal, String key);

View File

@ -426,12 +426,13 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService {
} }
@Override @Override
public Page<ProcessInstanceVo> getUserSubmittedList(Integer pageSize, Integer pageNo, String startUser, String code, public Page<ProcessInstanceVo> getUserSubmittedList(Integer pageSize, Integer pageNo, String processInstanceId, String startUser, String code,
Boolean finished, String[] startTimes, String keyword, String fieldId, String fieldVal, String key) { Boolean finished, String[] startTimes, String keyword, String fieldId, String fieldVal, String key) {
HistoricProcessInstanceQuery instanceQuery = historyService.createHistoricProcessInstanceQuery(); HistoricProcessInstanceQuery instanceQuery = historyService.createHistoricProcessInstanceQuery();
//TODO 多租户 //TODO 多租户
instanceQuery.processInstanceTenantId(TenantContextHolder.getTenantId()); instanceQuery.processInstanceTenantId(TenantContextHolder.getTenantId());
Executor.builder() Executor.builder()
.ifNotBlankNext(processInstanceId, instanceQuery::processInstanceId)
.ifNotBlankNext(startUser, instanceQuery::startedBy) .ifNotBlankNext(startUser, instanceQuery::startedBy)
.ifNotBlankNext(code, instanceQuery::processDefinitionKey) .ifNotBlankNext(code, instanceQuery::processDefinitionKey)
.ifTrueNext(null != startTimes && startTimes.length > 1, () -> { .ifTrueNext(null != startTimes && startTimes.length > 1, () -> {