devops 2 týždňov pred
rodič
commit
b7386c8bdf

+ 4 - 2
src/main/java/com/trs/wcmids/service/impl/WcmmetatablegovdocnewsServiceImpl.java

@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDate;
+import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -138,7 +140,7 @@ public class WcmmetatablegovdocnewsServiceImpl extends ServiceImpl<Wcmmetatableg
         return new Date(System.currentTimeMillis() - 10 * 60 * 1000);
     }
 //    private Date getTenMinutesAgo() {
-//        long fiveYearsInMillis = 5L * 365 * 24 * 60 * 60 * 1000;
-//        return new Date(System.currentTimeMillis() - fiveYearsInMillis);
+//        LocalDate tenYearsAgo = LocalDate.now().minusYears(10);
+//        return Date.from(tenYearsAgo.atStartOfDay(ZoneId.systemDefault()).toInstant());
 //    }
 }

+ 1 - 1
src/main/resources/mapper/SecondaryWcmmetatablegovdocnewsMapper.xml

@@ -4,7 +4,7 @@
 
     <!-- 查询最近10分钟内的数据(多siteid条件) -->
     <select id="selectRecentDataBySiteids" resultType="com.trs.wcmids.entity.Wcmmetatablegovdocnews">
-        select wd.docid,w.doctitle,w.dochtmlcon,w.docreltime,wd.crtime,wd.opertime,w.docreltime,w.channelid,w.docsourcename,wc.chnldesc,wd.docpuburl,wd.docstatus,wd.siteid from wcmmetatablegovdocnews w
+        select wd.docid,w.doctitle,w.dochtmlcon,w.docreltime,wd.crtime,wd.opertime,w.docreltime,wd.docchannel as channelid,w.docsourcename,wc.chnldesc,wd.docpuburl,wd.docstatus,wd.siteid from wcmmetatablegovdocnews w
         left join wcmdocument wd on w.metadataid=wd.docid
         left join wcmchannel wc on wc.channelid=wd.docchannel
         left join wcmchnldoc wcd on wcd.docid=wd.docid