package com.bonus.material.record.controller;

import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.service.ISltAgreementInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
* @description 结算记录查询
* @author hay
* @date   2025/2/19 10:43
*/
@Api(tags = "结算记录查询")
@RestController
@RequestMapping("/sltRecordQuery")
@Slf4j
public class SltRecordQueryController extends BaseController {

    @Autowired
    private ISltReocrdQueryService service;

    /**
     * 结算记录查询列表
     */
    @ApiOperation(value = "结算记录查询列表")
    @GetMapping("/getList")
    public TableDataInfo getList(SltAgreementInfo bean) {
        startPage();
        try {
            List<SltAgreementInfo> list = service.getList(bean);
            return getDataTable(list);
        } catch (Exception e) {
            return getDataTable(new ArrayList<>());
        }
    }


    /**
     * 结算记录查询列表--app
     */
    @ApiOperation(value = "结算记录查询列表")
    @GetMapping("/getAppList")
    public AjaxResult getAppList(SltAgreementInfo bean) {
        try {
            List<SltAgreementInfo> list = service.getAppList(bean);
            return AjaxResult.success(list);
        } catch (Exception e) {
            return AjaxResult.success(new ArrayList<>());
        }
    }

}
