package com.bonus.sgzb.material.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.material.domain.LeaseSceneRegist;
import com.bonus.sgzb.material.service.ILeaseSceneRegistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;

/**
 * 项目部出入记录lease_agreement_storageController
 * 
 * @author bonus
 * @date 2023-12-14
 */
@Api
@RestController
@RequestMapping("/leaseAgreementStorage")
public class LeaseSceneRegistController extends BaseController
{
    @Autowired
    private ILeaseSceneRegistService leaseSceneRegistService;

    /**
     * 查询出库入记录lease_agreement_storage列表
     */
    @ApiOperation(value = "查询出库入记录")
    @GetMapping("/list")
    public TableDataInfo list(LeaseSceneRegist leaseSceneRegist)
    {
        startPage();
        List<LeaseSceneRegist> list = leaseSceneRegistService.selectLeaseSceneRegistList(leaseSceneRegist);
        return getDataTable(list);
    }

    /**
     * 查询回库入记录lease_agreement_storage列表
     */
    @ApiOperation(value = "查询回库入记录")
    @GetMapping("/lists")
    public TableDataInfo lists(LeaseSceneRegist leaseSceneRegist)
    {
        startPage();
        List<LeaseSceneRegist> lists = leaseSceneRegistService.selectLeaseSceneRegistLists(leaseSceneRegist);
        return getDataTable(lists);
    }
    /**
     * 导出出库入记录入记录lease_agreement_storage列表
     */
    @ApiOperation(value = "导出出库入记录")
    @Log(title = "导出出库入记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, LeaseSceneRegist leaseSceneRegist)
    {
        List<LeaseSceneRegist> list = leaseSceneRegistService.selectLeaseSceneRegistList(leaseSceneRegist);
        ExcelUtil<LeaseSceneRegist> util = new ExcelUtil<LeaseSceneRegist>(LeaseSceneRegist.class);
        util.exportExcel(response, list, "出库入记录lease_agreement_storage数据");
    }

    /**
     * 导出出库入记录入记录lease_agreement_storage列表
     */
    @ApiOperation(value = "导出回库入记录")
    @Log(title = "导出出库入记录", businessType = BusinessType.EXPORT)
    @PostMapping("/exports")
    public void exports(HttpServletResponse response, LeaseSceneRegist leaseSceneRegist)
    {
        List<LeaseSceneRegist> list = leaseSceneRegistService.selectLeaseSceneRegistList(leaseSceneRegist);
        ExcelUtil<LeaseSceneRegist> util = new ExcelUtil<LeaseSceneRegist>(LeaseSceneRegist.class);
        util.exportExcel(response, list, "回库入记录lease_agreement_storage数据");
    }

}
