From bdbff65d70bf2e5f44dce5cfa253e5ae939f3ac4 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 12 Jul 2024 14:15:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E7=9A=84=E6=97=B6=E5=80=99=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6id=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApprovalLegAddAndChangeBatch.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/chint/domain/aggregates/approval/ApprovalLegAddAndChangeBatch.java b/src/main/java/com/chint/domain/aggregates/approval/ApprovalLegAddAndChangeBatch.java index e93a6a8b..02e1baa0 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/ApprovalLegAddAndChangeBatch.java +++ b/src/main/java/com/chint/domain/aggregates/approval/ApprovalLegAddAndChangeBatch.java @@ -15,8 +15,7 @@ import java.util.stream.Collectors; import static com.chint.domain.aggregates.approval.ApprovalMethod.APPROVE; import static com.chint.domain.aggregates.approval.ApprovalType.LEG_ADD_CHANGE_BATCH; -import static com.chint.infrastructure.constant.LegConstant.LEG_APPROVAL_STATUS_PREPARE; -import static com.chint.infrastructure.constant.LegConstant.LEG_APPROVAL_STATUS_SUBMIT; +import static com.chint.infrastructure.constant.LegConstant.*; public class ApprovalLegAddAndChangeBatch extends ApprovalProcess { @@ -113,26 +112,36 @@ public class ApprovalLegAddAndChangeBatch extends ApprovalProcess { if (this.getApprovalMethod() == null || this.getApprovalMethod().equals(APPROVE)) { //所有被提交审批的被加入审批事件 String approvalRecordNo = approvalData.getApprovalRecordNo(); - addApprovalEventAndRecord(LegApprovalEvent.submit(approvalRecordNo)); + addApprovalEventAndRecord(LEG_APPROVAL_STATUS_SUBMIT, approvalRecordNo); } else { //所有被提交审批的被加入知会事件 String approvalRecordNo = approvalData.getApprovalRecordNo(); - addApprovalEventAndRecord(LegApprovalEvent.notifyEvent(approvalRecordNo)); + addApprovalEventAndRecord(LEG_APPROVAL_STATUS_NOTIFY, approvalRecordNo); } bpmPlatform.submitLegAddOrChangeApproval(approvalData); return this; } - private void addApprovalEventAndRecord(LegApprovalEvent event) { + private void addApprovalEventAndRecord(Integer legApprovalEventType, String approvalRecordNo) { ApprovalRecord approvalRecord = this.getApprovalRecord(); approvalData.getAddLegList().forEach(leg -> { - leg.addEvent(event); - approvalRecord.addLeg(leg); + if (legApprovalEventType == LEG_APPROVAL_STATUS_SUBMIT) { + leg.addEvent(LegApprovalEvent.submit(approvalRecordNo)); + approvalRecord.addLeg(leg); + } else { + leg.addEvent(LegApprovalEvent.notifyEvent(approvalRecordNo)); + approvalRecord.addLeg(leg); + } }); approvalData.getChangeLegList().forEach(it -> { Leg newLeg = it.getFirst(); - newLeg.addEvent(event); - approvalRecord.addLeg(newLeg); + if (legApprovalEventType == LEG_APPROVAL_STATUS_SUBMIT) { + newLeg.addEvent(LegApprovalEvent.submit(approvalRecordNo)); + approvalRecord.addLeg(newLeg); + } else { + newLeg.addEvent(LegApprovalEvent.notifyEvent(approvalRecordNo)); + approvalRecord.addLeg(newLeg); + } }); bpmPlatform.submitLegAddOrChangeApproval(approvalData); }