package com.ruoyi.ibs.cmpm.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.ibs.cmpm.service.GridCmpmCustService;
import com.ruoyi.ibs.cmpm.service.GridCmpmService;
import com.ruoyi.ibs.customerselect.domain.CustBaseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author 吴凯程
 * @Date 2025/10/20
 **/
@Api(tags = "绩效网格")
@RestController
@RequestMapping("/grid/cmpm")
public class GridCmpmController extends BaseController {

    @Resource
    private GridCmpmCustService gridCmpmCustService;

    @Resource
    private GridCmpmService gridCmpmService;

    @PostMapping("/custBaseInfo/list")
    @ApiOperation("我的客户绩效网格查询")
    public AjaxResult selectCustBaseInfoList(@RequestBody CustBaseInfo custBaseInfo) {
        return AjaxResult.success( gridCmpmCustService.selectCustInfoRetailList (custBaseInfo)) ;
    }
    @GetMapping("/cust/list/tag")
    @ApiOperation("查询客户分层等级下拉框")
    @ApiImplicitParam(name = "gridType", value = "零售retail 对公corporate 对公账户corporate_account", required = true, dataType = "String")
    public AjaxResult custLevelListTag(@RequestParam String gridType) {
        return success(gridCmpmService.getAllCustLevel(gridType));
    }

}
