From c83cf9d2d82a0a29a15e38f4566eb470b9a3517b Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期二, 22 二月 2022 09:57:51 +0800
Subject: [PATCH] 抽奖相关提交

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
index dd45bcc..8c0c4bd 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -12,6 +12,7 @@
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -135,7 +136,9 @@
                 comActActivityDO.setStatus(3);
             }
         }
-
+        if(comActActivityVO.getType()==4){
+            comActActivityDO.setIsProject(1);
+        }
         boolean save = this.save(comActActivityDO);
         if (!save) {
             return R.fail();
@@ -317,6 +320,12 @@
                     comActActivityVO.setIsSign(1);
                     comActActivityVO.setIsVolunteer(comActActSignDO.getIsVolunteer());
                 }
+                List<ComActActRegistDO> regList = comActActRegistDAO.selectList(new QueryWrapper<ComActActRegistDO>().lambda()
+                        .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id).eq(ComActActRegistDO::getType, 1));
+                if (!regList.isEmpty()) {
+                    List<ComActActRegistDO> collect = regList.stream().sorted(Comparator.comparing(ComActActRegistDO::getId).reversed()).collect(Collectors.toList());
+                    comActActivityVO.setTimes(collect.get(0).getTimes());
+                }
             }
         }
         comActActivityVO.setCodeType(1);

--
Gitblit v1.7.1