|
@@ -21,6 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -88,6 +91,8 @@ public class WxHomeServiceImpl implements IWxHomeService {
|
|
|
if (!flag) {
|
|
|
saleInfos.get(0).setTopUp('Y');
|
|
|
}
|
|
|
+ saleInfos.sort(Comparator.comparing(RecSaleInfo::getEventStartTime, (t1, t2) -> t2.compareTo(t1)));
|
|
|
+ contents.sort(Comparator.comparing(RecContent::getCreateDate, (t1, t2) -> t2.compareTo(t1)));
|
|
|
result.put("saleInfo", saleInfos);
|
|
|
result.put("content", contents);
|
|
|
result.put("is_lottery", display);
|
|
@@ -127,6 +132,7 @@ public class WxHomeServiceImpl implements IWxHomeService {
|
|
|
BeanUtils.copyProperties(info, vo);
|
|
|
result.add(vo);
|
|
|
}
|
|
|
+ result.sort(Comparator.comparing(SaleInfoVo::getUpdateDate, (t1, t2) -> t2.compareTo(t1)));
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -158,4 +164,13 @@ public class WxHomeServiceImpl implements IWxHomeService {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 将字符串转日期成Long类型的时间戳,格式为:yyyy-MM-dd HH:mm:ss
|
|
|
+ */
|
|
|
+ public static Long convertTimeToLong(String time) {
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ LocalDateTime parse = LocalDateTime.parse(time, formatter);
|
|
|
+ return LocalDateTime.from(parse).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
|
|
+ }
|
|
|
}
|