From c02a5250e1eda3eb9b9db43595e9322895e95e78 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 23 Feb 2023 10:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=90=88=E5=85=A5=E5=BA=93=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=B3=BB=E7=BB=9F=E7=AB=AF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../depository_manage/service/impl/GroupServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java index 964c1055..b4b70d43 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java @@ -1101,21 +1101,26 @@ public class GroupServiceImpl implements GroupService { map.put("approverTime", System.currentTimeMillis()); // 根据当前主订单获取产生的对应子订单 List minInRecordList = depositoryRecordMapper.findApplicationInRecordPByToGroupId(mainRecordP.getId()); + + // 用于存储最终要删除的id列表 + List deleteIds = new ArrayList<>(); if (Integer.compare(approverPass, 1) == 0) { for (ApplicationInRecordP minRecordP : minInRecordList) { map.put("id", minRecordP.getId()); result += depositoryRecordService.reviewIn(map, userId, userToken, userAgent); + deleteIds.add(minRecordP.getId()); } map.put("id", id); } else { // 如果是要驳回 map.put("state", "驳回"); - List deleteIds = new ArrayList<>(); for (ApplicationInRecordP minRecordP : minInRecordList) { deleteIds.add(minRecordP.getId()); } + } + if (deleteIds.size() > 0) { depositoryRecordMapper.deleteApplicationInRecordByIds(deleteIds); } return depositoryRecordMapper.updateApplicationInRecord(map);