Kaynağa Gözat

处理线索客户没有客户报错

anderx 1 yıl önce
ebeveyn
işleme
f32171fb71

+ 7 - 5
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -66,11 +66,13 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         List<OutUserClueList> list = (List<OutUserClueList>) page.getList();
         LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
         LocalDateTime clueTime = null;
-        for (OutUserClueList e : list) {
-             clueTime=e.getClueTransferTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
-            clueTime = clueTime.withHour(0).withMinute(0).withSecond(0).plusDays(AFTConstants.CLUE_USER_MAX);
-            long between = ChronoUnit.DAYS.between(now,clueTime);
-            e.setDays((int) between);
+        if (!list.isEmpty()){
+            for (OutUserClueList e : list) {
+                clueTime=e.getClueTransferTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+                clueTime = clueTime.withHour(0).withMinute(0).withSecond(0).plusDays(AFTConstants.CLUE_USER_MAX);
+                long between = ChronoUnit.DAYS.between(now,clueTime);
+                e.setDays((int) between);
+            }
         }
         return page;
     }