package com.jy.business.contract.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jy.business.contract.model.dto.ContractFundReceivedDto;
import com.jy.business.contract.model.dto.ContractFundReceivedSelectDto;
import com.jy.business.contract.model.vo.ContractFundReceivedVo;
import com.jy.business.contract.service.ContractFundReceivedService;
import com.jy.framework.model.annotation.RecordAudit;
import com.jy.framework.model.base.BaseSelectDto;
import com.jy.framework.model.enums.BusinessType;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 合同到账 前端控制器
 * </p>
 *
 * @author 
 * @since 2025-06-11
 */
@RestController
@RequestMapping("/contractFundReceived")
public class ContractFundReceivedController {

    @Resource
    private ContractFundReceivedService contractFundReceivedService;

    /**
     * 合同到账分页
     */
    @GetMapping("/getList")
    public List<ContractFundReceivedVo> getList(ContractFundReceivedSelectDto dto) {
        return contractFundReceivedService.getList(dto);
    }

    /**
     * 合同到账分页
     */
    @GetMapping("/getPage")
    public Page<ContractFundReceivedVo> getPage(ContractFundReceivedSelectDto dto) {
        return contractFundReceivedService.getPage(dto);
    }

    /**
     * 合同到账明细
     */
    @GetMapping("/getDetail")
    public ContractFundReceivedVo getDetail(BaseSelectDto dto) {
        return contractFundReceivedService.getDetail(dto.getId());
    }

    /**
     * 确认到账
     */
    @RecordAudit(
            moduleName = "合同到账认领-确认到账",
            businessType = BusinessType.OTHER,
            businessIdField = "id"
    )
    @PostMapping("/confirmArrivalAccount")
    public void confirmArrivalAccount(@RequestBody ContractFundReceivedDto dto) {
        contractFundReceivedService.confirmArrivalAccount(dto);
    }

    ///**
    // * 合同到账编辑
    // */
    //@PostMapping("/edit")
    //public void edit(@RequestBody ContractFundReceivedDto dto) {
    //    contractFundReceivedService.edit(dto);
    //}
    //
    ///**
    // * 合同到账删除
    // */
    //@PostMapping("/delete")
    //public void delete(@RequestBody BaseSelectDto dto) {
    //    contractFundReceivedService.delete(dto.getIdList());
    //}

}
