package com.ruoyi.logistics.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.logistics.domain.BizFinancialFeeItems;
import com.ruoyi.logistics.service.IBizFinancialFeeItemsService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * PC-费用类型管理
 * 
 * @author RuiJing
 * @date 2026-01-29
 */
@RestController
@RequestMapping("/inancialFee")
public class BizFinancialFeeItemsController extends BaseController
{
    @Autowired
    private IBizFinancialFeeItemsService BizFinancialFeeItemsService;

    /**
     * 查询费用类型管理列表
     */
    @RequiresPermissions("system:inancialFee:list")
    @GetMapping("/list")
    public TableDataInfo list(BizFinancialFeeItems bizFinancialFeeItems)
    {
        startPage();
        List<BizFinancialFeeItems> list = BizFinancialFeeItemsService.selectBizFinancialFeeItemsList(bizFinancialFeeItems);
        return getDataTable(list);
    }

    /**
     * 导出费用类型管理列表
     */
    @RequiresPermissions("system:inancialFee:export")
    @Log(title = "费用类型管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BizFinancialFeeItems bizFinancialFeeItems)
    {
        List<BizFinancialFeeItems> list = BizFinancialFeeItemsService.selectBizFinancialFeeItemsList(bizFinancialFeeItems);
        ExcelUtil<BizFinancialFeeItems> util = new ExcelUtil<BizFinancialFeeItems>(BizFinancialFeeItems.class);
        util.exportExcel(response, list, "费用类型管理数据");
    }

    /**
     * 获取费用类型管理详细信息
     */
    @RequiresPermissions("system:inancialFee:query")
    @GetMapping(value = "/{feeItemId}")
    public AjaxResult getInfo(@PathVariable("feeItemId") Long feeItemId)
    {
        return success(BizFinancialFeeItemsService.selectBizFinancialFeeItemsByFeeItemId(feeItemId));
    }

    /**
     * 新增费用类型管理
     */
    @RequiresPermissions("system:inancialFee:add")
    @Log(title = "费用类型管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizFinancialFeeItems bizFinancialFeeItems)
    {
        return toAjax(BizFinancialFeeItemsService.insertBizFinancialFeeItems(bizFinancialFeeItems));
    }

    /**
     * 修改费用类型管理
     */
    @RequiresPermissions("system:inancialFee:edit")
    @Log(title = "费用类型管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizFinancialFeeItems bizFinancialFeeItems)
    {
        return toAjax(BizFinancialFeeItemsService.updateBizFinancialFeeItems(bizFinancialFeeItems));
    }

    /**
     * 删除费用类型管理
     */
    @RequiresPermissions("system:inancialFee:remove")
    @Log(title = "费用类型管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{feeItemIds}")
    public AjaxResult remove(@PathVariable Long[] feeItemIds)
    {
        return toAjax(BizFinancialFeeItemsService.deleteBizFinancialFeeItemsByFeeItemIds(feeItemIds));
    }
}
