package com.zt.plat.module.base.controller.admin.plandate;


import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDatePageReqVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.service.plandate.RealTimeReportsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.zt.plat.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 计划追踪报表")
@RestController
@RequestMapping("/base/real-time-reports")
@Validated
public class RealTimeReportsController {
    @Resource
    private RealTimeReportsService realTimeReportsService;
    @GetMapping("/tree")
    @Operation(summary = "查询追踪计划数据（树形结构）")
    @PreAuthorize("@ss.hasPermission('base:plan-date:query')")
    public CommonResult<?> listAllPlanDateTree(@Valid PlanDatePageReqVO pageReqVO) {
        return success(realTimeReportsService.tree(pageReqVO));
    }
}
