package com.sundot.airport.web.controller.item;

import com.sundot.airport.common.core.controller.BaseController;
import com.sundot.airport.common.core.domain.AjaxResult;
import com.sundot.airport.common.core.domain.BaseLargeScreenQueryParamDto;
import com.sundot.airport.item.domain.*;
import com.sundot.airport.item.service.ItemLargeScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 查获大屏Controller
 *
 * @author ruoyi
 * @date 2025-07-25
 */
@RestController
@RequestMapping("/item/largeScreen")
public class ItemLargeScreenController extends BaseController {

    @Autowired
    private ItemLargeScreenService itemLargeScreenService;

    /**
     * 移交公安情况
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/police")
    public AjaxResult police(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenInfoDto> result = itemLargeScreenService.police(dto);
        return success(result);
    }

    /**
     * 故意隐匿情况
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/conceal")
    public AjaxResult conceal(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenInfoDto> result = itemLargeScreenService.conceal(dto);
        return success(result);
    }

    /**
     * 查获类别分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/category")
    public AjaxResult category(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenCommonDto> result = itemLargeScreenService.category(dto);
        return success(result);
    }

    /**
     * 查获岗位分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/post")
    public AjaxResult post(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenCommonDto> result = itemLargeScreenService.post(dto);
        return success(result);
    }

    /**
     * 查获总数量+移交公安数量+故意隐匿数量
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/getTotalSome")
    public AjaxResult getTotalSome(BaseLargeScreenQueryParamDto dto) {
        ItemLargeScreenTotalSomeDto result = itemLargeScreenService.getTotalSome(dto);
        return success(result);
    }

    /**
     * app端查获总数量+移交公安数量+故意隐匿数量
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/getAppTotalSome")
    public AjaxResult getAppTotalSome(BaseLargeScreenQueryParamDto dto) {
        ItemLargeScreenTotalSomeDto result = itemLargeScreenService.getAppTotalSome(dto);
        return success(result);
    }

    /**
     * PC端-查获总数+移交公安+隐匿携带(不需要完成审核)
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/getPcTotalSome")
    public AjaxResult getPcTotalSome(BaseLargeScreenQueryParamDto dto) {
        ItemLargeScreenTotalSomeDto result = itemLargeScreenService.getPcTotalSome(dto);
        return success(result);
    }

    /**
     * 查获排名
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/rank")
    public AjaxResult rank(BaseLargeScreenQueryParamDto dto, int type) {
        List<ItemLargeScreenCommonDto> result = itemLargeScreenService.rank(dto, type);
        return success(result);
    }

    /**
     * 查获时段分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/timeSpan")
    public AjaxResult timeSpan(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenTimeSpanDto> result = itemLargeScreenService.timeSpan(dto);
        return success(result);
    }

    /**
     * 查获时段分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/appTimeSpan")
    public AjaxResult appTimeSpan(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenTimeSpanDto> result = itemLargeScreenService.appTimeSpan(dto);
        return success(result);
    }

    /**
     * 查获位置分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/position")
    public AjaxResult position(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenPositionDto> result = itemLargeScreenService.position(dto);
        return success(result);
    }

    /**
     * app端 查获位置分布
     *
     * @param dto 大屏查询参数
     * @return 查获位置分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/appPosition")
    public AjaxResult appPosition(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenPositionAppDto> result = itemLargeScreenService.appPosition(dto);
        return success(result);
    }

    /**
     * 查获通道分布
     */
    @PreAuthorize("@ss.hasPermi('item:record:list')")
    @GetMapping("/channel")
    public AjaxResult channel(BaseLargeScreenQueryParamDto dto) {
        List<ItemLargeScreenChannelDto> result = itemLargeScreenService.channel(dto);
        return success(result);
    }


}
