package com.jianshui.web.controller.system;

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

import com.jianshui.system.domain.InvoiceAllYhdj;
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.jianshui.common.annotation.Log;
import com.jianshui.common.core.controller.BaseController;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.enums.BusinessType;
import com.jianshui.common.utils.poi.ExcelUtil;
import com.jianshui.common.core.page.TableDataInfo;
import com.jianshui.system.service.IInvoiceAllYhdjService;

/**
 * 金四-用户登记Controller
 * 
 * @author jianshui
 * @date 2024-02-28
 */
@RestController
@RequestMapping("/invoiceall/invoiceallyhdj")
public class InvoiceAllYhdjController extends BaseController
{
    @Autowired
    private IInvoiceAllYhdjService invoiceAllYhdjService;

    /**
     * 查询金四-用户登记列表
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:list')")
    @GetMapping("/list")
    public TableDataInfo list(InvoiceAllYhdj invoiceAllYhdj)
    {
        startPage();
        List<InvoiceAllYhdj> list = invoiceAllYhdjService.selectInvoiceAllYhdjList(invoiceAllYhdj);
        return getDataTable(list);
    }

    /**
     * 导出金四-用户登记列表
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:export')")
    @Log(title = "金四-用户登记", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, InvoiceAllYhdj invoiceAllYhdj)
    {
        List<InvoiceAllYhdj> list = invoiceAllYhdjService.selectInvoiceAllYhdjList(invoiceAllYhdj);
        ExcelUtil<InvoiceAllYhdj> util = new ExcelUtil<InvoiceAllYhdj>(InvoiceAllYhdj.class);
        util.exportExcel(response, list, "金四-用户登记数据");
    }

    /**
     * 获取金四-用户登记详细信息
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(invoiceAllYhdjService.selectInvoiceAllYhdjById(id));
    }

    /**
     * 新增金四-用户登记
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:add')")
    @Log(title = "金四-用户登记", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody InvoiceAllYhdj invoiceAllYhdj)
    {
        return toAjax(invoiceAllYhdjService.insertInvoiceAllYhdj(invoiceAllYhdj));
    }

    /**
     * 修改金四-用户登记
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:edit')")
    @Log(title = "金四-用户登记", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody InvoiceAllYhdj invoiceAllYhdj)
    {
        return toAjax(invoiceAllYhdjService.updateInvoiceAllYhdj(invoiceAllYhdj));
    }

    /**
     * 删除金四-用户登记
     */
    @PreAuthorize("@ss.hasPermi('invoiceall:invoiceallyhdj:remove')")
    @Log(title = "金四-用户登记", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(invoiceAllYhdjService.deleteInvoiceAllYhdjByIds(ids));
    }
}
