大屏接口请求效率优化,票务接口改造 #42
@ -71,7 +71,10 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
LocalDate currentDate = LocalDate.now();
|
LocalDate currentDate = LocalDate.now();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
String formattedDate = currentDate.format(formatter);
|
String formattedDate = currentDate.format(formatter);
|
||||||
allByCertificateno = saleDataRepository.findAllByCertificatenoSDTime(formattedDate, formattedDate);
|
// 将当前日期加一天
|
||||||
|
LocalDate nextDay = currentDate.plusDays(1);
|
||||||
|
String nextDayFormatter = nextDay.format(formatter);
|
||||||
|
allByCertificateno = saleDataRepository.findAllByCertificatenoSDTime(formattedDate, nextDayFormatter);
|
||||||
}else {
|
}else {
|
||||||
allByCertificateno = saleDataRepository.findAllByCertificatenoSDTime(starTime, endTime);
|
allByCertificateno = saleDataRepository.findAllByCertificatenoSDTime(starTime, endTime);
|
||||||
}
|
}
|
||||||
@ -95,7 +98,10 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
LocalDate currentDate = LocalDate.now();
|
LocalDate currentDate = LocalDate.now();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
String formattedDate = currentDate.format(formatter);
|
String formattedDate = currentDate.format(formatter);
|
||||||
byAge = saleDataRepository.findByAge(formattedDate,formattedDate);
|
// 将当前日期加一天
|
||||||
|
LocalDate nextDay = currentDate.plusDays(1);
|
||||||
|
String nextDayFormatter = nextDay.format(formatter);
|
||||||
|
byAge = saleDataRepository.findByAge(formattedDate,nextDayFormatter);
|
||||||
}else {
|
}else {
|
||||||
byAge = saleDataRepository.findByAge(starTime,endTime);
|
byAge = saleDataRepository.findByAge(starTime,endTime);
|
||||||
}
|
}
|
||||||
@ -198,7 +204,10 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
LocalDate currentDate = LocalDate.now();
|
LocalDate currentDate = LocalDate.now();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
String formattedDate = currentDate.format(formatter);
|
String formattedDate = currentDate.format(formatter);
|
||||||
saleDataList = saleDataRepository.findAllByTransactiontypenoTime(formattedDate, formattedDate);
|
// 将当前日期加一天
|
||||||
|
LocalDate nextDay = currentDate.plusDays(1);
|
||||||
|
String nextDayFormatter = nextDay.format(formatter);
|
||||||
|
saleDataList = saleDataRepository.findAllByTransactiontypenoTime(formattedDate, nextDayFormatter);
|
||||||
}else {
|
}else {
|
||||||
saleDataList = saleDataRepository.findAllByTransactiontypenoTime(starTime, endTime);
|
saleDataList = saleDataRepository.findAllByTransactiontypenoTime(starTime, endTime);
|
||||||
}
|
}
|
||||||
@ -249,7 +258,10 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
LocalDate currentDate = LocalDate.now();
|
LocalDate currentDate = LocalDate.now();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
String formattedDate = currentDate.format(formatter);
|
String formattedDate = currentDate.format(formatter);
|
||||||
list = saleDataRepository.findAllByItemtypenameTime(formattedDate, formattedDate);
|
// 将当前日期加一天
|
||||||
|
LocalDate nextDay = currentDate.plusDays(1);
|
||||||
|
String nextDayFormatter = nextDay.format(formatter);
|
||||||
|
list = saleDataRepository.findAllByItemtypenameTime(formattedDate, nextDayFormatter);
|
||||||
}else {
|
}else {
|
||||||
list = saleDataRepository.findAllByItemtypenameTime(starTime, endTime);
|
list = saleDataRepository.findAllByItemtypenameTime(starTime, endTime);
|
||||||
}
|
}
|
||||||
@ -263,6 +275,20 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
mapArrayList.add(map);
|
mapArrayList.add(map);
|
||||||
// map.clear();
|
// map.clear();
|
||||||
}
|
}
|
||||||
|
if (mapArrayList.size() == 0){
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("TypeName","景点");
|
||||||
|
map.put("count","0");
|
||||||
|
mapArrayList.add(map);
|
||||||
|
HashMap<String, String> map1 = new HashMap<>();
|
||||||
|
map1.put("TypeName","公园");
|
||||||
|
map1.put("count","0");
|
||||||
|
mapArrayList.add(map1);
|
||||||
|
HashMap<String, String> map2 = new HashMap<>();
|
||||||
|
map2.put("TypeName","遗迹");
|
||||||
|
map2.put("count","0");
|
||||||
|
mapArrayList.add(map2);
|
||||||
|
}
|
||||||
|
|
||||||
return mapArrayList;
|
return mapArrayList;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user