package com.sundot.airport.web.controller.ledger;

import com.sundot.airport.common.core.controller.BaseController;
import com.sundot.airport.common.core.domain.AjaxResult;
import com.sundot.airport.common.dto.LedgerCommonQueryReqVO;
import com.sundot.airport.ledger.domain.vo.LedgerWarningDetailVO;
import com.sundot.airport.ledger.domain.vo.LedgerWarningVO;
import com.sundot.airport.ledger.service.ILedgerWarningService;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * 预警页面控制器
 */
@RestController
@RequestMapping("/ledger/warning")
public class LedgerWarningController extends BaseController {

    @Autowired
    private ILedgerWarningService ledgerWarningService;

    /**
     * 台账数据
     */
    @PostMapping("/ledger")
    public AjaxResult ledger(@RequestBody LedgerCommonQueryReqVO queryReq) {
        LedgerWarningVO result = ledgerWarningService.ledger(queryReq);
        return AjaxResult.success(result);
    }

    /**
     * 员工综合评估预警看板
     */
    @PostMapping("/ledgerDetail")
    public AjaxResult ledgerDetail(@RequestBody LedgerCommonQueryReqVO queryReq) {
        LedgerWarningDetailVO result = ledgerWarningService.ledgerDetail(queryReq);
        return AjaxResult.success(result);
    }

}
