From 05d2baaf2d08c40c5f163c609297f35d9503a9ed Mon Sep 17 00:00:00 2001 From: Harry Yang Date: Wed, 4 Jan 2023 15:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E5=92=8C?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=AE=A1=E6=A0=B8=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/service/ProjectProcessService.java | 26 +++++++++++++------ .../admin/business/process-completed.ftl | 4 ++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/palmte/work/service/ProjectProcessService.java b/src/main/java/cn/palmte/work/service/ProjectProcessService.java index 67cc405..da74f32 100644 --- a/src/main/java/cn/palmte/work/service/ProjectProcessService.java +++ b/src/main/java/cn/palmte/work/service/ProjectProcessService.java @@ -133,20 +133,30 @@ public class ProjectProcessService { * 更新流程 审批人,和状态 * * @param processId 流程Id - * @param auditId 审批人ID + * @param auditId 审批人ID 可以为空 * @param status 流程状态 可以为空,为空的时候不修改 */ public void updateAudit(int processId, ProcessStatus status, List auditId) { - String currentAudit = getCurrentAudit(auditId); - String currentAuditId = auditId.stream().map(String::valueOf).collect(Collectors.joining(",")); - if (status != null) { - if (!CollectionUtils.isEmpty(auditId)) { - jdbcTemplate.update( - "update project_process set current_audit=?,current_audit_id=?,status=? where id=?", currentAudit, currentAuditId, status.getValue(), processId); + if (CollectionUtils.isEmpty(auditId)) { + if (status != null) { + jdbcTemplate.update("update project_process set current_audit=?,current_audit_id=?,status=? where id=?", + null, null, status.getValue(), processId); + } + else { + jdbcTemplate.update("update project_process set current_audit=?,current_audit_id=? where id=?", + null, null, processId); } } else { - jdbcTemplate.update("update project_process set current_audit=?,current_audit_id=? where id=?", currentAudit, currentAuditId, processId); + String currentAudit = getCurrentAudit(auditId); + String currentAuditId = auditId.stream().map(String::valueOf).collect(Collectors.joining(",")); + if (status != null) { + jdbcTemplate.update("update project_process set current_audit=?,current_audit_id=?,status=? where id=?", + currentAudit, currentAuditId, status.getValue(), processId); + } + else { + jdbcTemplate.update("update project_process set current_audit=?,current_audit_id=? where id=?", currentAudit, currentAuditId, processId); + } } } diff --git a/src/main/resources/templates/admin/business/process-completed.ftl b/src/main/resources/templates/admin/business/process-completed.ftl index 7671a18..aa38b13 100644 --- a/src/main/resources/templates/admin/business/process-completed.ftl +++ b/src/main/resources/templates/admin/business/process-completed.ftl @@ -115,7 +115,9 @@ {{scope.row.status | processStatus}} - + + {{cope.row.currentAudit}} +