luodangjia
2024-11-04 e0fc8f7e2230b51e3bbe8dea43790cf11b7170e9
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TParkingRecordController.java
@@ -67,11 +67,15 @@
                .like(query.getLicensePlate() != null, TParkingRecord::getLicensePlate, query.getLicensePlate())
                .eq(query.getStatus() != null, TParkingRecord::getStatus, query.getStatus())
                .eq(query.getOutParkingType() != null, TParkingRecord::getOutParkingType, query.getOutParkingType())
                .orderByDesc(TParkingRecord::getCreateTime)
                .page(Page.of(query.getPageCurr(), query.getPageSize()));
        for (TParkingRecord record : page.getRecords()) {
            record.setName(parkingLotService.getById(record.getParkingLotId()).getName());
            TParkingLot byId = parkingLotService.getById(record.getParkingLotId());
            record.setUid(record.getId().toString());
            if (byId!=null) {
                record.setParkName(byId.getName());
            }
        }
        return R.ok(page);
    }
@@ -200,7 +204,7 @@
            List<Map<String, Object>> charMap = new ArrayList<>();
            // 生成从 "00:00" 到 "23:00" 的时间数据
            // 生成从 "00:00" 到 "23:00" 的时间数据-------
            for (int hour = 0; hour < 24; hour++) {
                String time = String.format("%02d:00", hour);
                Map<String, Object> mapWithTimeValue = findMapWithTimeValue(maps, time);
@@ -325,8 +329,8 @@
        List<TParkingRecord> list = parkingRecordService.lambdaQuery().eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()).list();
        int count1 = list.size();
        //统计出list中chargingOrderId为null的数据个数
        int count2 = list.stream().filter(item -> item.getChargingOrderId() == null).collect(Collectors.toList()).size();
        int count3 = count1-count2;
        int count2 = list.stream().filter(item -> item.getChargingOrderId() != null).collect(Collectors.toList()).size();
        int count3 = list.stream().filter(item -> item.getOutParkingType() == 2).collect(Collectors.toList()).size();
        //计算出list中parkingDuration的总和
        int count4 = 0;
        for (TParkingRecord tParkingRecord : list) {