/*
 * Copyright ©2023 CJB-CNIT Team. All rights reserved
 */
package com.openhis.web.reportmanage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.core.common.core.domain.R;
import com.openhis.web.reportmanage.appservice.IMonthlySettlementReportAppService;

import lombok.extern.slf4j.Slf4j;


/**
 *  对账 controller
 *
 * @author liuhr
 * @date 2025-07-25
 */
@RestController
@RequestMapping("/report-manage/monthly-settlement")
@Slf4j
public class MonthlySettlementController {

    @Autowired
    private IMonthlySettlementReportAppService monthlySettlementReportAppService;

    /**
     * 页面初始化
     *
     * @return 初始化信息
     */
    @GetMapping(value = "/init")
    public R<?> init() {
        return monthlySettlementReportAppService.init();
    }
    /**
     * 月末结算报表（统计筛选时间区内）
     *
     * @param locationId 库房
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @return 月末结算报表
     */
    @GetMapping(value = "/month")
    public R<?> selectMonthlySettlementReport(@RequestParam Long locationId, @RequestParam String startTime,
        @RequestParam String endTime) {

        return R.ok(monthlySettlementReportAppService.selectMonthlySettlementReport(locationId, startTime, endTime));
    }

}
