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.AccountDeptRunningWaterDetailVo;
import com.fjhx.account.entity.account.dto.AccountDeptRunningWaterDetailSelectDto;
import com.fjhx.account.entity.account.dto.AccountDeptRunningWaterDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.account.service.account.AccountDeptRunningWaterDetailService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


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

    @Autowired
    private AccountDeptRunningWaterDetailService accountDeptRunningWaterDetailService;

    /**
     * 资金流水分拆部门表分页
     */
    @PostMapping("/page")
    public Page<AccountDeptRunningWaterDetailVo> page(@RequestBody AccountDeptRunningWaterDetailSelectDto dto) {
        return accountDeptRunningWaterDetailService.getPage(dto);
    }

    /**
     * 资金流水分拆部门表明细
     */
    @PostMapping("/detail")
    public AccountRunningWaterVo detail(@RequestBody BaseSelectDto dto) {
        return accountDeptRunningWaterDetailService.detail(dto.getId());
    }

    /**
     * 资金流水分拆部门表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AccountRunningWaterVo accountRunningWaterVo) {
        accountDeptRunningWaterDetailService.add(accountRunningWaterVo);
    }

    /**
     * 资金流水分拆部门表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody AccountDeptRunningWaterDetailDto accountDeptRunningWaterDetailDto) {
        accountDeptRunningWaterDetailService.edit(accountDeptRunningWaterDetailDto);
    }

    /**
     * 资金流水分拆部门表删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        accountDeptRunningWaterDetailService.delete(dto.getId());
    }

}
