Pu Zhibing
2025-05-08 5b64f31f1d35b38b51935b5fa7f4b8cf46fbf4cf
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TParkingLotController.java
@@ -33,6 +33,7 @@
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
@@ -158,6 +159,19 @@
    }
    
    
    /**
     * 获取所有停车场数据
     */
    @PostMapping(value = "/getAllParkingLot")
    public R<List<TParkingLot>> getAllParkingLot(){
        List<TParkingLot> list = parkingLotService.list(new LambdaQueryWrapper<TParkingLot>()
                .eq(TParkingLot::getDelFlag, 0));
        return R.fail(list);
    }
    @RequiresPermissions(value = {"/paymentOrder/order"}, logical = Logical.OR)
    @GetMapping(value = "/getRecordById")
    public R<TParkingRecord> getRecordById(@RequestParam("id") Long id){
@@ -167,8 +181,8 @@
    
    
    @PostMapping(value = "/getRecordAmount")
    public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore){
        BigDecimal sum =  parkingRecordService.getSum(sixBefore);
    public R<BigDecimal> getRecordAmount(){
        BigDecimal sum =  parkingRecordService.getSum();
        return R.ok(sum);
    }
    
@@ -188,7 +202,18 @@
    R<Integer> getSiteIdByOrderId(@RequestParam("id") Long id){
        TParkingRecord byId = parkingRecordService.getById(id);
        TParkingLot parkingLot = parkingLotService.getById(byId.getParkingLotId());
        return R.ok(parkingLot.getId());
        return R.ok(parkingLot.getSiteId());
    }
    @PostMapping(value = "/getSiteIdAll")
    R<List<TParkingRecord>> getSiteIdAll(){
        List<TParkingRecord> list = parkingRecordService.list();
        for (TParkingRecord tParkingRecord : list) {
            TParkingLot parkingLot = parkingLotService.getById(tParkingRecord.getParkingLotId());
            if (parkingLot!=null){
                tParkingRecord.setSiteId(parkingLot.getSiteId());
            }
        }
        return R.ok(list);
    }
}