package com.fjhx.account.controller.account;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.account.entity.account.vo.AccountRunningWaterVo;
import com.fjhx.common.constant.SourceConstant;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.account.entity.account.vo.AccountDeptRunningWaterVo;
import com.fjhx.account.entity.account.dto.AccountDeptRunningWaterSelectDto;
import com.fjhx.account.entity.account.dto.AccountDeptRunningWaterDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.account.service.account.AccountDeptRunningWaterService;
import org.springframework.beans.factory.annotation.Autowired;

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


/**
 * <p>
 * 部门-资金流水关联表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-13
 */
@DS(SourceConstant.ACCOUNT)
@RestController
@RequestMapping("/accountDeptRunningWater")
public class AccountDeptRunningWaterController {

    @Autowired
    private AccountDeptRunningWaterService accountDeptRunningWaterService;

    /**
     * 部门-资金流水关联表分页
     */
    @PostMapping("/page")
    public Page<AccountRunningWaterVo> page(@RequestBody AccountDeptRunningWaterSelectDto dto) {
        return accountDeptRunningWaterService.getPage(dto);
    }


    /**
     * 部门-资金流水关联表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AccountDeptRunningWaterDto accountDeptRunningWaterDto) {
        accountDeptRunningWaterService.add(accountDeptRunningWaterDto);
    }

    /**
     * 部门-资金流水报表
     *
     * @param dto
     * @return
     */
    @PostMapping("/DeptRunningWaterReport")
    public List<Map<String, Object>> DeptRunningWaterReport(@RequestBody AccountDeptRunningWaterSelectDto dto) {
        return accountDeptRunningWaterService.DeptRunningWaterReport(dto);
    }

    /**
     * 部门-资金流水统计（ 部门-资金流水列表）
     *
     * @param dto
     * @return
     */
    @PostMapping("/deptRunningWaterStatistics")
    public Map<String, Object> deptRunningWaterStatistics(@RequestBody AccountDeptRunningWaterSelectDto dto) {
        return accountDeptRunningWaterService.deptRunningWaterStatistics(dto);
    }


}
