package com.casic.missiles.controller.cockpit;

import com.casic.missiles.dto.ReturnDTO;
import com.casic.missiles.dto.ReturnUtil;
import com.casic.missiles.dto.cockpit.*;
import com.casic.missiles.service.cockpit.ICustomerBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 计量管理驾驶舱-客户业务
 * @Author: wangpeng
 * @Date: 2023/6/14 16:45
 */
@Api(tags = "计量管理驾驶舱-客户业务")
@Slf4j
@RestController
@RequestMapping("/cockpit/customer/business")
public class CustomerBusinessController {
    @Autowired
    private ICustomerBusinessService customerBusinessService;

    /**
     * 业务趋势，今年每月订单数量、样品数量
     */
    @ApiOperation("业务趋势")
    @GetMapping("/busTrend")
    public ReturnDTO<BusTrendResponse> busTrendList() {
        return ReturnUtil.success(customerBusinessService.busTrendList());
    }

    /**
     * 经营趋势，今年每月收入合同金额+业务结算
     */
    @ApiOperation("经营趋势")
    @GetMapping("/manageTrend")
    public ReturnDTO<ManageTrendResponse> manageTrendList() {
        return ReturnUtil.success(customerBusinessService.manageTrendList());
    }

    @ApiOperation("投诉意见")
    @GetMapping("/advice")
    public ReturnDTO<AdviceResponse> advice() throws Exception {
        return ReturnUtil.success(customerBusinessService.adviceList());
    }

    @ApiOperation("业务覆盖")
    @GetMapping("/coverage")
    public ReturnDTO<CoverageResponse> coverage() {
        return ReturnUtil.success(customerBusinessService.coverage());
    }

    @ApiOperation("客户反馈")
    @GetMapping("/feedback")
    public ReturnDTO<FeedbackResponse> feedback() {
        return ReturnUtil.success(customerBusinessService.feedback());
    }

    @ApiOperation("城市业务TOP10")
    @GetMapping("/city/top")
    public ReturnDTO<CityTopResponse> cityTop() {
        return ReturnUtil.success(customerBusinessService.cityTop());
    }
}
