package com.ruoyi.invest.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.invest.domain.dto.AnalysisDto;
import com.ruoyi.invest.service.IStatisticAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

import java.util.Map;

/**
 * 统计分析Controller
 * @author 22077662
 */
@Api(tags = "统计分析")
@RestController
@RequestMapping("/analysis")
public class StatisticAnalysisController {

    @Autowired
    private IStatisticAnalysisService iStatisticAnalysisService;

    @ApiOperation("账户总览-基础信息")
    @GetMapping("/accountAnalysis/getIncomeInfo")
    public Map<String,Object> getIncomeInfo(){
        Map<String, Object> resultMap = iStatisticAnalysisService.getIncomeInfo();
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("账户总览-基础信息")
    @GetMapping("/accountAnalysis/getBaseAccountInfo")
    public Map<String,Object> getBaseAccountInfo(){
        Map<String, Object> resultMap = iStatisticAnalysisService.getBaseAccountInfo();
        return AjaxResult.success(resultMap);
    }



    @ApiOperation("账户总览-负债信息")
    @GetMapping("/accountAnalysis/getDebetInfo")
    public Map<String,Object> getDebetInfo(){
        Map<String, Object> resultMap = iStatisticAnalysisService.getDebetInfo();
        return AjaxResult.success(resultMap);
    }

    @ApiOperation("账户总览-信用卡信息")
    @GetMapping("/accountAnalysis/getCreditInfo")
    public Map<String,Object> getCreditInfo(){
        Map<String, Object> resultMap = iStatisticAnalysisService.getCreditInfo();
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("信用卡统计分析")
    @GetMapping("/creditAnalysis")
    public Map<String,Object> getCreditAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getCreditAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }

    @ApiOperation("期货股票统计分析")
    @GetMapping("/futuresStocksAnalysis")
    public Map<String,Object> getFuturesStocksAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getFuturesStocksAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }

    @ApiOperation("分期历史未结清待还统计分析")
    @GetMapping("/installmentHistoryAnalysis")
    public Map<String,Object> getInstallmentHistoryAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getInstallmentHistoryAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("征信查询统计分析")
    @GetMapping("/creditRecordAnalysis")
    public Map<String,Object> getCreditRecordAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getCreditRecordAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("分期历史统计分析")
    @GetMapping("/installmentSettledAnalysis")
    public Map<String,Object> getInstallmentSettledAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getInstallmentSettledAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }

    @ApiOperation("记账账户统计分析")
    @GetMapping("/accountsAnalysis")
    public Map<String,Object> getAccountsAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getAccountsAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("POS机刷卡统计分析")
    @GetMapping("/posAnalysis")
    public Map<String,Object> getPosAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getPosAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }


    @ApiOperation("交易记录统计分析")
    @GetMapping("/accountsDealAnalysis")
    public Map<String,Object> getAccountsDealAnalysis(AnalysisDto analysisDto){
        Map<String, Object> resultMap = iStatisticAnalysisService.getAccountsDealAnalysis(analysisDto);
        return AjaxResult.success(resultMap);
    }








}
