package com.spider.quartz.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.spider.common.annotation.Log;
import com.spider.common.core.controller.BaseController;
import com.spider.common.core.domain.AjaxResult;
import com.spider.common.enums.BusinessType;
import com.spider.quartz.domain.EuUnqualifiedGoodsZh;
import com.spider.quartz.service.IEuUnqualifiedGoodsZhService;
import com.spider.common.utils.poi.ExcelUtil;
import com.spider.common.core.page.TableDataInfo;

/**
 * 欧盟不合格商品展示-翻译Controller
 * 
 * @author ruoyi
 * @date 2025-12-05
 */
@RestController
@RequestMapping("/bus/euzh")
public class EuUnqualifiedGoodsZhController extends BaseController
{
    @Autowired
    private IEuUnqualifiedGoodsZhService euUnqualifiedGoodsZhService;

    /**
     * 查询欧盟不合格商品展示-翻译列表
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:list')")
    @GetMapping("/list")
    public TableDataInfo list(EuUnqualifiedGoodsZh euUnqualifiedGoodsZh)
    {
        startPage();
        List<EuUnqualifiedGoodsZh> list = euUnqualifiedGoodsZhService.selectEuUnqualifiedGoodsZhList(euUnqualifiedGoodsZh);
        return getDataTable(list);
    }

    /**
     * 导出欧盟不合格商品展示-翻译列表
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:export')")
    @Log(title = "欧盟不合格商品展示-翻译", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EuUnqualifiedGoodsZh euUnqualifiedGoodsZh)
    {
        List<EuUnqualifiedGoodsZh> list = euUnqualifiedGoodsZhService.selectEuUnqualifiedGoodsZhList(euUnqualifiedGoodsZh);
        ExcelUtil<EuUnqualifiedGoodsZh> util = new ExcelUtil<EuUnqualifiedGoodsZh>(EuUnqualifiedGoodsZh.class);
        util.exportExcel(response, list, "欧盟不合格商品展示-翻译数据");
    }

    /**
     * 获取欧盟不合格商品展示-翻译详细信息
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(euUnqualifiedGoodsZhService.selectEuUnqualifiedGoodsZhById(id));
    }

    /**
     * 新增欧盟不合格商品展示-翻译
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:add')")
    @Log(title = "欧盟不合格商品展示-翻译", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EuUnqualifiedGoodsZh euUnqualifiedGoodsZh)
    {
        return toAjax(euUnqualifiedGoodsZhService.insertEuUnqualifiedGoodsZh(euUnqualifiedGoodsZh));
    }

    /**
     * 修改欧盟不合格商品展示-翻译
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:edit')")
    @Log(title = "欧盟不合格商品展示-翻译", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EuUnqualifiedGoodsZh euUnqualifiedGoodsZh)
    {
        return toAjax(euUnqualifiedGoodsZhService.updateEuUnqualifiedGoodsZh(euUnqualifiedGoodsZh));
    }

    /**
     * 删除欧盟不合格商品展示-翻译
     */
    @PreAuthorize("@ss.hasPermi('bus:euzh:remove')")
    @Log(title = "欧盟不合格商品展示-翻译", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(euUnqualifiedGoodsZhService.deleteEuUnqualifiedGoodsZhByIds(ids));
    }
}
