From ed4f07531b9cb0794e976a14cee3b591dec8d4f6 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期六, 20 七月 2024 21:22:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
index 2d12b44..0748925 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsGroupPurchaseServiceImpl.java
@@ -285,6 +285,7 @@
         groupPurchase.setGroupStatus(
                 res ? GroupStatusEnum.FORMED_INTO_A_GROUP : GroupStatusEnum.GROUP_FAILURE);
         groupPurchase.setStartStatus(StartStatusEnum.ENDED);
+
         this.updateById(groupPurchase);
     }
 
@@ -322,7 +323,7 @@
                     });
                     try {
                         log.info(
-                                "============  =================退款结束=============================");
+                                "=============================退款结束=============================");
                         log.info("退款成功订单:{}",
                                 objectMapper.writeValueAsString(successfulOrders));
                         log.info("退款失败订单:{}", objectMapper.writeValueAsString(failedOrders));
@@ -349,6 +350,13 @@
                 orderClient.updateOrderStatusByMubres(formedGroupMubres, SecurityConstants.INNER);
                 return true;
             }
+            List<GoodsGroupPurchaseInfo> notGroupedList = groupPurchaseInfoList.stream()
+                    .filter(g -> !g.getCurrentNumber()
+                            .equals(g.getGroupSize())).peek(p -> {
+                        p.setGroupStatus(GroupStatusEnum.GROUP_FAILURE.getCode());
+                    }).collect(
+                            Collectors.toList());
+            goodsGroupPurchaseInfoService.updateBatchById(notGroupedList);
         }
         return false;
     }

--
Gitblit v1.7.1