Browse Source

seo 重构

zq940222 5 months ago
parent
commit
88fc4c0f98

+ 7 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/serp/service/impl/SearchKeywordsServiceImpl.java

@@ -23,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 
 /**
@@ -225,8 +227,7 @@ public class SearchKeywordsServiceImpl implements ISearchKeywordsService {
         // 达成时间
         Date achieveTime = history.getKeywordsAchieveTime();
         if (achieveTime != null) {
-            ServerTimeVO.setReachStandardTime(
-                    DateUtil.dateToString(achieveTime, DateUtil.DATE_FORMAT_ONE));
+            ServerTimeVO.setReachStandardTime(new SimpleDateFormat(DateUtil.DATE_PATTERN).format(achieveTime));
         }
 
         // 达成天数
@@ -238,13 +239,12 @@ public class SearchKeywordsServiceImpl implements ISearchKeywordsService {
             List<HistoryReachStandardSite> historyReachStandardSiteList =
                     historyReachStandardSiteService.list(historyReachStandardSiteQueryWrapper);
             if (ListUtil.isEmpty(historyReachStandardSiteList)) {
-                reachStandardDays = DateUtil.diffDay(achieveTime, DateUtil.nowDate());
+                reachStandardDays = DateUtil.diffDay(achieveTime, new Date());
             } else {
                 HistoryReachStandardSite historyReachStandardSite =
                         historyReachStandardSiteList.get(0);
                 int newDays =
-                        DateUtil.diffDay(
-                                historyReachStandardSite.getCreateTime(), DateUtil.nowDate());
+                        DateUtil.diffDay(historyReachStandardSite.getCreateTime(), new Date());
                 reachStandardDays = historyReachStandardSite.getReachStandardDays() + newDays;
             }
         }
@@ -287,12 +287,12 @@ public class SearchKeywordsServiceImpl implements ISearchKeywordsService {
             Date serverEndTime = history.getServiceEndTime();
             log.info(
                     "getServerTimeVO -- 原来的serverEndTime:{}",
-                    DateUtil.dateToString(serverEndTime, DateUtil.DATE_FORMAT_ONE));
+                    new SimpleDateFormat(DateUtil.DATE_PATTERN).format(serverEndTime));
             serverEndTime = DateUtil.addDate(serverEndTime, totalGiveAndCompensateDay, 3);
             log.info(
                     "getServerTimeVO -- 增加赠、补天数:{},赠送天数、补偿天数后的serverEndTime:{}",
                     totalGiveAndCompensateDay,
-                    DateUtil.dateToString(serverEndTime, DateUtil.DATE_FORMAT_ONE));
+                    new SimpleDateFormat(DateUtil.DATE_PATTERN).format(serverEndTime));
             if (serverEndTime.compareTo(new Date()) <= 0) {
                 remainServerDays = 0;
             } else {