sjy #16
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess;
|
package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AreaDataVO;
|
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AreaDataVO;
|
||||||
|
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.EntryRecordVo;
|
||||||
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.ParkingLotDataVO;
|
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.ParkingLotDataVO;
|
||||||
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.RevenueVO;
|
import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.RevenueVO;
|
||||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.*;
|
import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.*;
|
||||||
@ -20,6 +21,7 @@ import java.math.RoundingMode;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@ -94,6 +96,22 @@ public class VehicleAccessApi {
|
|||||||
LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX);
|
LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX);
|
||||||
List<EntryRecord> entryRecords = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay);
|
List<EntryRecord> entryRecords = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay);
|
||||||
parkingLotDataVO.setIntoNum(entryRecords.size());//车辆进入数
|
parkingLotDataVO.setIntoNum(entryRecords.size());//车辆进入数
|
||||||
|
//固定车临时车
|
||||||
|
int temporaryCar = 0;
|
||||||
|
int fixationCar = 0;
|
||||||
|
for (int i = 0; i < entryRecords.size(); i++) {
|
||||||
|
for (int j = 0; j < entryRecords.get(i).getDatas().size(); j++) {
|
||||||
|
EntryRecordVo entryRecordVo = entryRecords.get(i).getDatas().get(j);
|
||||||
|
if (entryRecordVo.getCarType().equals("临时车")){
|
||||||
|
temporaryCar ++ ;
|
||||||
|
}
|
||||||
|
if (entryRecordVo.getCarType().equals("固定车")){
|
||||||
|
fixationCar ++ ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parkingLotDataVO.setTemporaryCar(temporaryCar);
|
||||||
|
parkingLotDataVO.setFixationCar(fixationCar);
|
||||||
List<AppearanceRecord> appearanceRecords = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay);
|
List<AppearanceRecord> appearanceRecords = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay);
|
||||||
parkingLotDataVO.setOutNum(appearanceRecords.size());//车辆出入数
|
parkingLotDataVO.setOutNum(appearanceRecords.size());//车辆出入数
|
||||||
|
|
||||||
|
@ -33,6 +33,12 @@ public class ParkingLotDataVO {
|
|||||||
//总利用率
|
//总利用率
|
||||||
private Double useRatio;
|
private Double useRatio;
|
||||||
|
|
||||||
|
//临时车数量
|
||||||
|
private int temporaryCar;
|
||||||
|
|
||||||
|
//固定车数量
|
||||||
|
private int fixationCar;
|
||||||
|
|
||||||
//区域停车场数据集合
|
//区域停车场数据集合
|
||||||
private List<AreaDataVO> areaDataVOList = new ArrayList<>();
|
private List<AreaDataVO> areaDataVOList = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user