package com.ruoyi.web.controller.fleet.statusTracking;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.orderManagement.domain.Ftmsorderbillscars;
import com.ruoyi.orderManagement.service.IftmsorderbillscarsService;
import com.ruoyi.orderManagement.statusTracking.service.IftmsorderbillsfeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 单趟费用Controller
 *
 * @author ruoyi
 * @date 2021-02-22
 */
@RestController
@RequestMapping("/fleet/ftmsorderbillsfees")
public class ftmsorderbillsfeesController extends BaseController {

    @Autowired
    private IftmsorderbillsfeesService iftmsorderbillsfeesService;


    /**
     * 根据id查询费用详细信息
     */
    @PreAuthorize("@ss.hasPermi('fleet:ftmsorderbillsfees:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        if (StringUtils.isNull(id)) {
            return AjaxResult.error("未找到查询条件，请确认");
        }
        return AjaxResult.success(iftmsorderbillsfeesService.selectFTmsorderbillsfeesByIdMap(id));
    }

    /**
     *   费用提交
     */
    @PreAuthorize("@ss.hasPermi('fleet:ftmsorderbillsfees:add')")
    @Log(title = "【车辆】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestParam("ftmsorderbillsfees") String ftmsorderbillsfees )
    {
        return iftmsorderbillsfeesService.insertFTmsorderbillsfeesAdd(ftmsorderbillsfees);
    }






}
