From 86df207c37502cce1b2043e1c7c0486459eef1d6 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期四, 13 三月 2025 19:58:45 +0800
Subject: [PATCH] 党员、诉求评论基础代码

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java
index 027f871..97bab78 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java
@@ -40,7 +40,39 @@
     }
 
     @Override
-    public int insertVolunteer(VolunteerActivityVO mostBeautifulVolunteerVO) {
+    public int insertVolunteer(VolunteerActivityVO mostBeautifulVolunteerVO)
+    {
+        Long applyBegintime = mostBeautifulVolunteerVO.getApplyBeginTime().getTime();
+        //活动报名结束时间
+        Long applyEndtime = mostBeautifulVolunteerVO.getApplyEndTime().getTime();
+
+        //活动开始时间
+        Long actityBegintime = mostBeautifulVolunteerVO.getActityBeginTime().getTime();
+        //活动结束时间
+        Long actityEndtime = mostBeautifulVolunteerVO.getActityEndTime().getTime();
+
+        Long newTiem=System.currentTimeMillis();
+
+        //判断是否在报名中
+        if (newTiem >= applyBegintime && newTiem < applyEndtime)
+        {
+            mostBeautifulVolunteerVO.setAcState("3");
+        }
+        else if (newTiem>applyEndtime  && newTiem <actityBegintime )
+        {
+             mostBeautifulVolunteerVO.setAcState("4");
+        }
+        else if (newTiem >= actityBegintime && newTiem <= actityEndtime)
+        {
+            //判断是否活动进行中
+            mostBeautifulVolunteerVO.setAcState("4");
+        }
+        else if(newTiem>actityEndtime)
+        {
+            //活动结束
+            mostBeautifulVolunteerVO.setAcState("5");
+        }
+
         return baseMapper.insertVolunteer(mostBeautifulVolunteerVO);
     }
 

--
Gitblit v1.7.1