package com.securitycontrol.system.base.controller;

import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.entity.system.dto.MenuDto;
import com.securitycontrol.entity.system.dto.SelectDto;
import com.securitycontrol.system.base.service.ISelectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author：cwchen
 * @date：2024-02-21-18:25
 * @version：1.0
 * @description：公共下拉选/树
 */
@RestController
@RequestMapping("/sys/select/")
public class SelectController extends BaseController {

    @Resource(name = "ISelectService")
    private ISelectService service;

    @ApiOperation(value = "组织机构树")
    @PostMapping("getOrgTree")
    public AjaxResult getOrgTree() {
        return service.getOrgTree();
    }

    @ApiOperation(value = "角色下拉选")
    @PostMapping("getRoleLists")
    public AjaxResult getRoleLists() {
        return service.getRoleLists();
    }

    @ApiOperation(value = "菜单树")
    @PostMapping("getMenuTree")
    public AjaxResult getMenuTree(MenuDto dto) {
        return service.getMenuTree(dto);
    }

    @ApiOperation(value = "字典树结构下拉选")
    @PostMapping("getDictList")
    public AjaxResult getDictList(String code) {
        return service.getDictList(code);
    }


    @PostMapping("getDictSelect")
    public AjaxResult getDictSelect(String code) {
        return service.getDictSelect(code);
    }

    @ApiOperation(value = "建管单位下拉选")
    @GetMapping("getBuildLists")
    public AjaxResult getBuildLists() {
        return service.getBuildLists();
    }


    @ApiOperation(value = "杆塔表下拉选")
    @GetMapping("getGtLists")
    public AjaxResult getGtLists(String bidCode) {
        return service.getGtLists(bidCode);
    }

    @ApiOperation(value = "字典集合下拉选")
    @GetMapping("getDictLists")
    public AjaxResult getDictLists(SelectDto dto) {
        return service.getDictLists(dto);
    }

    @ApiOperation(value = "杆塔下拉选/变电工序下拉选")
    @GetMapping("getTowerLists")
    public AjaxResult getTowerLists(SelectDto dto){
        return service.getTowerLists(dto);
    }

    @ApiOperation(value = "班组下拉选")
    @GetMapping("getTeamLists")
    public AjaxResult getTeamLists(SelectDto dto){
        return service.getTeamLists(dto);
    }

    @ApiOperation(value = "工程下拉选")
    @GetMapping("getProLists")
    public AjaxResult getProLists(SelectDto dto){
        return service.getProLists(dto);
    }

    @ApiOperation(value = "区域下拉选")
    @GetMapping("getAreaLists")
    public AjaxResult getAreaLists(SelectDto dto){
        return service.getAreaLists(dto);
    }

    @ApiOperation(value = "边带下拉选")
    @GetMapping("getBdLists")
    public AjaxResult getBdLists(SelectDto dto){
        return service.getBdLists(dto);
    }

    @ApiOperation(value = "工程下拉选")
    @GetMapping("getProList")
    public AjaxResult getProList(SelectDto dto){
        return service.getProList(dto);
    }

    @ApiOperation(value = "告警管理下拉选")
    @GetMapping("getSelectLists")
    public AjaxResult getSelectLists() {
        return service.getSelectLists();
    }


    @ApiOperation(value = "项目下拉选")
    @GetMapping("getProjectList")
    public AjaxResult getProjectList(SelectDto dto){
        return service.getProjectList(dto);
    }

    @ApiOperation(value = "单项工程下拉选")
    @GetMapping("getSignProList")
    public AjaxResult getSignProList(SelectDto dto){
        return service.getSignProList(dto);
    }
}
