package com.ruoyi.ibs.grid.controller;


import com.github.pagehelper.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataPageInfo;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ibs.grid.domain.entity.GridUnionCustGongsi;
import com.ruoyi.ibs.grid.domain.entity.LicenseAuthorization965;
import com.ruoyi.ibs.grid.service.TabPersonalService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

import static com.ruoyi.common.utils.PageUtils.startPage;

@Api(tags = "个性化报表")
@RestController
@RequestMapping("/tabPersonal")
public class TabPersonalController extends BaseController {

    @Resource
    private TabPersonalService tabPersonalService;



    @Log(title = "临海客户授权")
    @ApiOperation(value = "查询临海客户授权")
    @GetMapping("/licenseAuthorization")
    public TableDataPageInfo<LicenseAuthorization965> licenseAuthorization(String dt) {
        Page<Object> page = startPage();
        if(!SecurityUtils.getDeptId().toString().startsWith("965")){
            return getDataTable(new ArrayList<>(), page);
        }
        List<LicenseAuthorization965> list = tabPersonalService.selectLicenseAuthorization965t(dt);
        return getDataTable(list, page);
    }
}
