package com.dk.mdm.controller.report;

import com.alibaba.fastjson.JSONObject;
import com.dk.common.controller.BaseController;
import com.dk.common.model.pojo.PageList;
import com.dk.common.response.ResponseResultVO;
import com.dk.common.service.BaseService;
import com.dk.mdm.service.common.CommonService;
import com.dk.mdm.service.report.ReportService;
import com.google.gson.JsonObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @desc   : 报表数据源
 * @author : 常皓宁
 * @date   : 2024/4/11 8:49
 */
@Api(tags = "报表数据源API")
@RestController
@RequestMapping("/mst/report")
public class ReportController  {

    @Autowired
    private ReportService reportService;

    @ApiOperation(
            value = "获取库存",
            notes = "获取库存"
    )
    @PostMapping("get_ivt_detail_report")
    public ResponseResultVO<List<Map<String, Object>>> getIvtDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getIvtDetailReport(param);
    }

    /**
     * @desc   : 采购明细表
     * @author : 宋扬
     * @date   : 2024/4/10 16:37
     */
    @PostMapping("get_pur_detail_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getPurDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getPurDetailReport(param);
    }

    /**
     * @desc   : 销售明细报表
     * @author : 宋扬
     * @date   : 2024/4/11 16:22
     */
    @PostMapping("get_order_detail_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getOrderDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getOrderDetailReport(param);
    }

    /**
     * @desc   : 出库明细报表
     * @author : 宋扬
     * @date   : 2024/4/11 16:53
     */
    @PostMapping("get_outbound_detail_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getOutboundDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getOutboundDetailReport(param);
    }
    /**
     * @desc   : 入库明细报表
     * @author : 宋扬
     * @date   : 2024/4/11 16:53
     */
    @PostMapping("get_inbound_detail_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getInboundDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getInboundDetailReport(param);
    }

    /**
     * @desc   : 客户收款明细表
     * @author : 宋扬
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_rec_pay_detail_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getRecPayDetailReport(@RequestBody Map<String, Object> param) {
        return reportService.getRecPayDetailReport(param);
    }
    /**
     * @desc   : 销售跟踪表 列表查询
     * @author : 于继渤
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_sales_tracking_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getSalesTrackingReport(@RequestBody Map<String, Object> param) {
        return reportService.getSalesTrackingReport(param);
    }

    /**
     * @desc   : 销售明细
     * @author : 于继渤
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_sales_item_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getSalesItemReport(@RequestBody Map<String, Object> param) {
        return reportService.getSalesItemReport(param);
    }

    /**
     * @desc   : 采购跟踪表 列表查询
     * @author : 王英杰
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_pur_tracking_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getPurTrackingReport(@RequestBody Map<String, Object> param) {
        return reportService.getPurTrackingReport(param);
    }
    /**
     * @desc   : 采购跟踪表 明细查询
     * @author : 王英杰
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_pur_tracking_report_detail/{id}")
    public ResponseResultVO<List<Map<String, Object>>> getPurTrackingReportDetail(@PathVariable String id) {
        return reportService.getPurTrackingReportDetail(id);
    }

    /**
     * @desc   : 销售跟踪表 明细查询
     * @author : 于继渤
     * @date   : 2024/4/16 11:27
     */
    @PostMapping("get_sale_tracking_report_detail/{id}")
    public ResponseResultVO<List<Map<String, Object>>> getSalesTrackingReportDetail(@PathVariable String id) {
        return reportService.getSalesTrackingReportDetail(id);
    }

    /**
     * @desc   : 日结对账表
     * @date   : 2024/4/24 15:10
     * @author : 寇珊珊
     */
    @PostMapping("get_daily_reconciliation_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReport(@RequestBody Map<String, Object> param) {
        return reportService.getDailyReconciliationReport(param);
    }

    /**
     * @desc   : 日结对账表-查销售订单
     * @date   : 2024/4/24 15:10
     * @author : 寇珊珊
     */
    @PostMapping("get_daily_reconciliation_report_by_order")
    public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByOrder(@RequestBody Map<String, Object> param) {
        return reportService.getDailyReconciliationReportByOrder(param);
    }

    /**
     * @desc   : 日结对账表-查销售出库
     * @date   : 2024/4/24 15:10
     * @author : 寇珊珊
     */
    @PostMapping("get_daily_reconciliation_report_by_out")
    public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByOut(@RequestBody Map<String, Object> param) {
        return reportService.getDailyReconciliationReportByOut(param);
    }


    /**
     * @desc   : 日结对账表-查收款单
     * @date   : 2024/4/24 15:10
     * @author : 寇珊珊
     */
    @PostMapping("get_daily_reconciliation_report_by_pay")
    public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByPay(@RequestBody Map<String, Object> param) {
        return reportService.getDailyReconciliationReportByPay(param);
    }

    /**
     * @desc   : 收发存汇总报表
     * @author : 宋扬
     * @date   : 2024/4/23 14:08
     */
    @PostMapping("get_ivt_sum_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getIvtSumReport(@RequestBody Map<String, Object> param) {
        return reportService.getIvtSumReport(param);
    }

    /**
     * @desc   : 收发存汇总报表-明细
     * @author : 宋扬
     * @date   : 2024/4/23 14:08
     */
    @PostMapping("get_ivt_item_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getIvtItemReport(@RequestBody Map<String, Object> param) {
        return reportService.getIvtItemReport(param);
    }

    /**
     * @desc   : 供应商往来余额表
     * @author : 常皓宁
     * @date   : 2024/4/25 13:21
     */
    @PostMapping("get_sup_account")
    public ResponseResultVO<PageList<Map<String, Object>>> getSupAccount(@RequestBody  Map<String, Object> param) {
        return reportService.getSupAccount(param);
    }

    /**
     * @desc   : 供应商往来余额表明细
     * @author : 常皓宁
     * @date   : 2024/4/25 13:21
     */
    @PostMapping("get_sup_account_item")
    public ResponseResultVO<List<Map<String, Object>>> getSupAccountItem(@RequestBody  Map<String, Object> param) {
        return reportService.getSupAccountItem(param);
    }

    /**
     * @desc   : 资金日记账
     * @author : 常皓宁
     * @date   : 2024/4/26 16:43
     */
    @PostMapping("get_fund_report")
    public ResponseResultVO<PageList<Map<String, Object>>> getFundReport(@RequestBody  Map<String, Object> param) {
        return reportService.getFundReport(param);
    }


    /**
     * @desc   : 销售简报
     * @date   : 2024/5/6 8:42
     * @author : 寇珊珊
     */
    @PostMapping("get_report_batch")
    public ResponseResultVO<?>getReportBatch(@RequestBody Map<String,Map<String,Object>> params){
        return reportService.getReportBatch(params);
    }



}





