package vip.xiaonuo.money.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.money.entity.MoneyProducePrice;
import vip.xiaonuo.money.entity.MoneyWriteOverdue;
import vip.xiaonuo.money.param.MoneyBusinessPageParam;
import vip.xiaonuo.money.param.MoneyInOutParam;
import vip.xiaonuo.money.param.MoneyWriteOverdueAddParam;
import vip.xiaonuo.money.service.IMoneyWriteOverdueService;

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

/**
 * <p>
 * 财务应收分析逾期填报 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-02-26
 */
@RestController
@Api(tags = "财务应收分析逾期填报")
@ApiSupport(author = "SNOWY_TEAM", order = 1)
@Validated
public class MoneyWriteOverdueController {

    @Autowired
    private IMoneyWriteOverdueService writeOverdueService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("财务应收分析逾期填报新增")
    @PostMapping("/money-write-overdue/add")
    public CommonResult<CommonResult> listProduceProfit(@RequestBody MoneyWriteOverdueAddParam param) {
        return CommonResult.data(writeOverdueService.add(param));
    }

    @ApiOperationSupport(order = 2)
    @ApiOperation("财务应收分析逾期填报分页")
    @PostMapping("/money-write-overdue/page")
    public CommonResult<Page<MoneyWriteOverdue>> page(@RequestBody MoneyBusinessPageParam pageParam) {
        return CommonResult.data(writeOverdueService.page(pageParam));
    }

    @ApiOperationSupport(order = 3)
    @ApiOperation("财务应收分析逾期填报修改")
    @PostMapping("/money-write-overdue/edit")
    public CommonResult<CommonResult> edit(@RequestBody MoneyWriteOverdue writeOverdue) {
        return CommonResult.data(writeOverdueService.edit(writeOverdue));
    }

    @ApiOperationSupport(order = 4)
    @ApiOperation("财务应收分析逾期填报删除")
    @PostMapping("/money-write-overdue/delete")
    public CommonResult<CommonResult> delete(@RequestBody Map<String, String> paramsMap) {
        return CommonResult.data(writeOverdueService.delete(paramsMap));
    }
}
