package com.project.zcustom.controller.officalCar;

import com.project.common.core.domain.AjaxResult;
import com.project.zcustom.service.car.ILargePlatCarService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/large/car")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlatCarController {

    @Autowired
    private ILargePlatCarService largePlatCarService;

    /**
     * 资源台账
     */
    @GetMapping("/resource")
    public AjaxResult getResource(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatCarService.getResource(appOrg));
    }

    /**
     * 2025年度公务车车辆明细
     */
    @GetMapping("/carDetail")
    public AjaxResult getCarDetail(@RequestParam String appOrg, @RequestParam Long flag, @RequestParam Long pageSize, @RequestParam Long page) {
        return AjaxResult.success("查询成功", largePlatCarService.getCarDetail(appOrg, flag, pageSize, page));
    }

    /**
     * 监控管理
     */
    @GetMapping("/monitor")
    public AjaxResult getMonitor(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatCarService.getMonitor(appOrg));
    }

    /**
     * 公务车预警明细
     */
    @GetMapping("/warnDetail")
    public AjaxResult getWarnDetail(@RequestParam String appOrg, @RequestParam String alertType, @RequestParam Long pageSize, @RequestParam Long page) {
        return AjaxResult.success("查询成功", largePlatCarService.getWarnDetail(appOrg, alertType, pageSize, page));
    }

    /**
     * 运行管理 上
     */
    @GetMapping("/operationManageTopHalf")
    public AjaxResult getOperationManageTopHalf(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", largePlatCarService.getOperationManageTopHalf(appOrg));
    }

    /**
     * 运行管理 下
     */
    @GetMapping("/operationManageLastHalf")
    public AjaxResult getOperationManageLastHalf() {
        return AjaxResult.success("查询成功", largePlatCarService.getOperationManageLastHalf());
    }

    /**
     * 所有地市各自的公务车总数
     */
    @GetMapping("/selfCarNum")
    public AjaxResult getSelfCarNum() {
        return AjaxResult.success("查询成功", largePlatCarService.getSelfCarNum());
    }
}
