大屏接口响应速率优化
This commit is contained in:
parent
bb4d98583f
commit
e2da11b0a9
@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.data.mongodb.core.mapping.Document;
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
|
||||||
//@Document("checkticket")
|
@Document("checkticket")
|
||||||
@Document("check_ticket_today")
|
//@Document("check_ticket_today")
|
||||||
//@Document("checktickettest")
|
//@Document("checktickettest")
|
||||||
@Data
|
@Data
|
||||||
public class CheckTicket {
|
public class CheckTicket {
|
||||||
|
@ -20,8 +20,8 @@ public interface CheckTicketRepository extends MongoRepository<CheckTicket,Strin
|
|||||||
@Query("{'checktickettime':{'$gte': ?0, '$lt': ?1},'checkticketdate':{'$dt': ?2}}")
|
@Query("{'checktickettime':{'$gte': ?0, '$lt': ?1},'checkticketdate':{'$dt': ?2}}")
|
||||||
List<CheckTicket> findByTimestampBetweenAndCheckticketdate(String startTime, String endTime,String day);
|
List<CheckTicket> findByTimestampBetweenAndCheckticketdate(String startTime, String endTime,String day);
|
||||||
|
|
||||||
List<CheckTicket> findByCheckticketdateAndChecktickettimeBetween(String day,String startTime, String endTime);
|
Long countByCheckticketdateAndChecktickettimeBetween(String day,String startTime, String endTime);
|
||||||
|
|
||||||
@Query("{'checkticketdate':{'$gte': ?0, '$lt': ?1} , 'checktickettime':{'$gte': ?2, '$lt': ?3}}")
|
// @Query("{'checkticketdate':{'$gte': ?0, '$lt': ?1} , 'checktickettime':{'$gte': ?2, '$lt': ?3}}")
|
||||||
List<CheckTicket> findByCheckticketdateBetweenAndChecktickettimeBetween(String startTime, String endTime,String beingTime, String resultTime);
|
Long countByCheckticketdateBetweenAndChecktickettimeBetween(String startTime, String endTime,String beingTime, String resultTime);
|
||||||
}
|
}
|
||||||
|
@ -41,14 +41,14 @@ public class CheckTicketServiceImpl implements CheckTicketService {
|
|||||||
LocalDateTime hourEndTime = hourStartTime.plusHours(1);
|
LocalDateTime hourEndTime = hourStartTime.plusHours(1);
|
||||||
String begintime = formatter.format(hourStartTime);
|
String begintime = formatter.format(hourStartTime);
|
||||||
String resulttime = formatter.format(hourEndTime);
|
String resulttime = formatter.format(hourEndTime);
|
||||||
List<CheckTicket> checkTickets;
|
Long checkTickets;
|
||||||
if (starTime != null && endTime != null && starTime.equals(endTime)){
|
if (starTime != null && endTime != null && starTime.equals(endTime)){
|
||||||
checkTickets = checkTicketRepository.findByCheckticketdateAndChecktickettimeBetween(starTime,begintime,resulttime);
|
checkTickets = checkTicketRepository.countByCheckticketdateAndChecktickettimeBetween(starTime,begintime,resulttime);
|
||||||
}else {
|
}else {
|
||||||
checkTickets = checkTicketRepository.findByCheckticketdateBetweenAndChecktickettimeBetween(starTime,endTime,begintime,resulttime);
|
checkTickets = checkTicketRepository.countByCheckticketdateBetweenAndChecktickettimeBetween(starTime,endTime,begintime,resulttime);
|
||||||
}
|
}
|
||||||
map.put("date",begintime+"-"+resulttime);
|
map.put("date",begintime+"-"+resulttime);
|
||||||
map.put("count", String.valueOf(checkTickets.stream().count()));
|
map.put("count", String.valueOf(checkTickets));
|
||||||
mapList.add(map);
|
mapList.add(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user