package com.ruoyi.web.controller.warehouse.warehouseBusiness;

import java.util.List;

import com.ruoyi.warehouseBusiness.domain.TWarehousebillsCntritemsLogger;
import com.ruoyi.warehouseBusiness.service.ITWarehousebillsCntritemsLoggerService;
import org.springframework.security.access.prepost.PreAuthorize;
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.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 凯和箱明细(修改记录)Controller
 * 
 * @author ruoyi
 * @date 2021-07-05
 */
@RestController
@RequestMapping("/warehouse/tWarehousebillsCntritemsLogger")
public class TWarehousebillsCntritemsLoggerController extends BaseController
{
    @Autowired
    private ITWarehousebillsCntritemsLoggerService tWarehousebillsCntritemsLoggerService;

    /**
     * 查询凯和箱明细(修改记录)列表
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:list')")
    @GetMapping("/list")
    public TableDataInfo list(TWarehousebillsCntritemsLogger tWarehousebillsCntritemsLogger)
    {
        startPage();
        List<TWarehousebillsCntritemsLogger> list = tWarehousebillsCntritemsLoggerService.selectTWarehousebillsCntritemsLoggerList(tWarehousebillsCntritemsLogger);
        return getDataTable(list);
    }

    /**
     * 导出凯和箱明细(修改记录)列表
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:export')")
    @Log(title = "凯和箱明细(修改记录)", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TWarehousebillsCntritemsLogger tWarehousebillsCntritemsLogger)
    {
        List<TWarehousebillsCntritemsLogger> list = tWarehousebillsCntritemsLoggerService.selectTWarehousebillsCntritemsLoggerList(tWarehousebillsCntritemsLogger);
        ExcelUtil<TWarehousebillsCntritemsLogger> util = new ExcelUtil<TWarehousebillsCntritemsLogger>(TWarehousebillsCntritemsLogger.class);
        return util.exportExcel(list, "logger");
    }

    /**
     * 获取凯和箱明细(修改记录)详细信息
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:query')")
    @GetMapping(value = "/{fId}")
    public AjaxResult getInfo(@PathVariable("fId") Long fId)
    {
        return AjaxResult.success(tWarehousebillsCntritemsLoggerService.selectTWarehousebillsCntritemsLoggerById(fId));
    }

    /**
     * 新增凯和箱明细(修改记录)
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:add')")
    @Log(title = "凯和箱明细(修改记录)", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TWarehousebillsCntritemsLogger tWarehousebillsCntritemsLogger)
    {
        return toAjax(tWarehousebillsCntritemsLoggerService.insertTWarehousebillsCntritemsLogger(tWarehousebillsCntritemsLogger));
    }

    /**
     * 修改凯和箱明细(修改记录)
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:edit')")
    @Log(title = "凯和箱明细(修改记录)", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TWarehousebillsCntritemsLogger tWarehousebillsCntritemsLogger)
    {
        return toAjax(tWarehousebillsCntritemsLoggerService.updateTWarehousebillsCntritemsLogger(tWarehousebillsCntritemsLogger));
    }

    /**
     * 删除凯和箱明细(修改记录)
     */
    @PreAuthorize("@ss.hasPermi('warehouse:logger:remove')")
    @Log(title = "凯和箱明细(修改记录)", businessType = BusinessType.DELETE)
	@DeleteMapping("/{fIds}")
    public AjaxResult remove(@PathVariable Long[] fIds)
    {
        return toAjax(tWarehousebillsCntritemsLoggerService.deleteTWarehousebillsCntritemsLoggerByIds(fIds));
    }
}
