package cn.iocoder.yudao.module.visit.controller.admin.home;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.visit.controller.admin.home.vo.*;
import cn.iocoder.yudao.module.visit.service.customerinfo.CustomerInfoService;
import cn.iocoder.yudao.module.visit.service.home.HomeService;
import cn.iocoder.yudao.module.visit.service.product.ProductService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 首页信息")
@RestController
@RequestMapping("/visit/home")
@Validated
public class HomeController {

    @Resource
    private CustomerInfoService customerInfoService;
    @Resource
    private ProductService  productService;
    @Resource
    private HomeService homeService;


    @GetMapping("/getHomeInfoFirst")
    @Operation(summary = "获得首页第一排信息")
    public CommonResult<HomeFirstRespVO> getHomeInfoFirst(@Valid HomeReqVO reqVO) {
        HomeFirstRespVO data = homeService.getHomeInfoFirst(reqVO);
        return success(data);
    }


    @GetMapping("/getHomeInfoBfztj")
    @Operation(summary = "获得首页拜访周统计")
    public CommonResult<HomeBfztjRespVO> getHomeInfoBfztj(@Valid HomeReqVO reqVO) {
        HomeBfztjRespVO data = homeService.getHomeInfoBfztj(reqVO);
        return success(data);
    }


    @GetMapping("/getHomeInfoKhxzdjzbqk")
    @Operation(summary = "获得首页客户性质等级占比情况")
    public CommonResult<HomeKhxzdjzbqkRespVO> getHomeInfoKhxzdjzbqk(@Valid HomeReqVO reqVO) {
        HomeKhxzdjzbqkRespVO data = homeService.getHomeInfoKhxzdjzbqk(reqVO);
        return success(data);
    }

    @GetMapping("/getHomeInfoBfrjfbqk")
    @Operation(summary = "获得首页拜访人均分布情况")
    public CommonResult<HomeBfrjfbqkRespVO> getHomeInfoBfrjfbqk(@Valid HomeReqVO reqVO) {
        HomeBfrjfbqkRespVO data = homeService.getHomeInfoBfrjfbqk(reqVO);
        return success(data);
    }

    @GetMapping("/getHomeInfoKhbffszbqk")
    @Operation(summary = "获得首页客户拜访方式占比情况")
    public CommonResult<HomeKhxzdjzbqkRespVO> getHomeInfoKhbffszbqk(@Valid HomeReqVO reqVO) {
        HomeKhxzdjzbqkRespVO data = homeService.getHomeInfoKhbffszbqk(reqVO);
        return success(data);
    }

    @GetMapping("/getHomeInfoKhbmzbqk")
    @Operation(summary = "获得首页客户部门占比情况")
    public CommonResult<HomeKhxzdjzbqkRespVO> getHomeInfoKhbmzbqk(@Valid HomeReqVO reqVO) {
        HomeKhxzdjzbqkRespVO data = homeService.getHomeInfoKhbmzbqk(reqVO);
        return success(data);
    }

    @GetMapping("/getHomeInfoKhbflxzbqk")
    @Operation(summary = "获得首页客户拜访类型占比情况")
    public CommonResult<HomeKhxzdjzbqkRespVO> getHomeInfoKhbflxzbqk(@Valid HomeReqVO reqVO) {
        HomeKhxzdjzbqkRespVO data = homeService.getHomeInfoKhbflxzbqk(reqVO);
        return success(data);
    }

    @GetMapping("/getHomeInfoBfcplxzbqk")
    @Operation(summary = "获得首页拜访产品类型占比情况")
    public CommonResult<HomeBfrjfbqkRespVO> getHomeInfoBfcplxzbqk(@Valid HomeReqVO reqVO) {
        HomeBfrjfbqkRespVO data = homeService.getHomeInfoBfcplxzbqk(reqVO);
        return success(data);
    }


    @GetMapping("/getHomeInfoBfrtj")
    @Operation(summary = "获得首页拜访日统计")
    public CommonResult<HomeBfrtjRespVO> getHomeInfoBfrtj(@Valid HomeReqVO reqVO) {
        HomeBfrtjRespVO data = homeService.getHomeInfoBfrtj(reqVO);
        return success(data);
    }







}