From 7514013fffeee1e6ce1d7a3a27ab0e80ef772eca Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期五, 12 七月 2024 11:11:23 +0800
Subject: [PATCH] 花城 【小程序】统计排行新数据详情报错

---
 springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemInventoryServiceImpl.java |   76 ++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemInventoryServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemInventoryServiceImpl.java
index 24d08b1..f949f43 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemInventoryServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/NeedProblemInventoryServiceImpl.java
@@ -68,46 +68,52 @@
     public NeedProblemInventoryDTO getDetails(String id,String userIds)
     {
         NeedProblemInventoryDTO item=baseMapper.getDetails(id,userIds);
-        //当前时间
-        long newTime = System.currentTimeMillis();
-        //活动报名时间
-        long applyStartTime = item.getClaimStartTime().getTime();
-        //报名结束时间
-        long applyEndTime = item.getClaimEndTime().getTime();
-        //活动开始时间
-        long activityStartTime = item.getNeedStartTime().getTime();
-        //活动结束时间
-        long activityEndTime = item.getNeedEndTime().getTime();
+
+        if(item!=null)
+        {
+            //当前时间
+            long newTime = System.currentTimeMillis();
+            //活动报名时间
+            long applyStartTime = item.getClaimStartTime().getTime();
+            //报名结束时间
+            long applyEndTime = item.getClaimEndTime().getTime();
+            //活动开始时间
+            long activityStartTime = item.getNeedStartTime().getTime();
+            //活动结束时间
+            long activityEndTime = item.getNeedEndTime().getTime();
 
 
-        switch (item.getStatus()) {
-            //待开始
-            case "1":
-                if (newTime > applyEndTime) {
-                    //报名结束
-                    NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO();
-                    vo.setId(item.getId());
-                    vo.setStatus("2");
-                    item.setStatus("2");
-                    baseMapper.editData(vo);
-                }
+            switch (item.getStatus()) {
+                //待开始
+                case "1":
+                    if (newTime > applyEndTime) {
+                        //报名结束
+                        NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO();
+                        vo.setId(item.getId());
+                        vo.setStatus("2");
+                        item.setStatus("2");
+                        baseMapper.editData(vo);
+                    }
 
-                break;
-            //报名中
-            case "2":
-                if (newTime > activityEndTime) {
-                    NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO();
-                    vo.setId(item.getId());
-                    vo.setStatus("3");
-                    item.setStatus("3");
-                    baseMapper.editData(vo);
-                }
-                break;
-            //已开始
-            case "3":
+                    break;
+                //报名中
+                case "2":
+                    if (newTime > activityEndTime) {
+                        NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO();
+                        vo.setId(item.getId());
+                        vo.setStatus("3");
+                        item.setStatus("3");
+                        baseMapper.editData(vo);
+                    }
+                    break;
+                //已开始
+                case "3":
 
-                break;
+                    break;
+            }
         }
+
+
         return item;
     }
 

--
Gitblit v1.7.1