diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index fe7742c3..a3c7502f 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -180,6 +180,23 @@ public class TAbilityApplicationController { Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class); index.setEnded(Boolean.TRUE.equals(ended)); } + + /** + * 判断该次申请是否存在驳回的子单 + */ + // 该条申请的实例id列表 + String inStanceIdsSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s';", index.getApplyFlag()); + List> inStanceIds = jdbcTemplate.queryForList(inStanceIdsSql); + index.setBackToFirst(inStanceIds.stream().map(inStanceId_ -> { + List listTask = taskService.createTaskQuery().processInstanceId(inStanceId_.get("instance_id").toString()) + .includeProcessVariables().includeTaskLocalVariables().list(); + return listTask.stream().anyMatch(task -> + task.getProcessVariables().containsKey("backToFirst") ? + (task.getProcessVariables().get("backToFirst") != null ? Boolean.valueOf(task.getProcessVariables().get("backToFirst").toString()) : Boolean.FALSE) + : Boolean.FALSE + ); + }).filter(i -> i).findAny().isPresent()); // 子单内是否存在驳回流程 + /** * 处理催办条件与催办信息 */