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.JapanUnqualifiedGoodsZh;
import com.spider.quartz.service.IJapanUnqualifiedGoodsZhService;
import com.spider.common.utils.poi.ExcelUtil;
import com.spider.common.core.page.TableDataInfo;

/**
 * 日本不合格商品展示-翻译Controller
 * 
 * @author ruoyi
 * @date 2025-12-05
 */
@RestController
@RequestMapping("/bus/japanzh")
public class JapanUnqualifiedGoodsZhController extends BaseController
{
    @Autowired
    private IJapanUnqualifiedGoodsZhService japanUnqualifiedGoodsZhService;

    /**
     * 查询日本不合格商品展示-翻译列表
     */
    @PreAuthorize("@ss.hasPermi('bus:japanzh:list')")
    @GetMapping("/list")
    public TableDataInfo list(JapanUnqualifiedGoodsZh japanUnqualifiedGoodsZh)
    {
        startPage();
        List<JapanUnqualifiedGoodsZh> list = japanUnqualifiedGoodsZhService.selectJapanUnqualifiedGoodsZhList(japanUnqualifiedGoodsZh);
        return getDataTable(list);
    }

    /**
     * 导出日本不合格商品展示-翻译列表
     */
    @PreAuthorize("@ss.hasPermi('bus:japanzh:export')")
    @Log(title = "日本不合格商品展示-翻译", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, JapanUnqualifiedGoodsZh japanUnqualifiedGoodsZh)
    {
        List<JapanUnqualifiedGoodsZh> list = japanUnqualifiedGoodsZhService.selectJapanUnqualifiedGoodsZhList(japanUnqualifiedGoodsZh);
        ExcelUtil<JapanUnqualifiedGoodsZh> util = new ExcelUtil<JapanUnqualifiedGoodsZh>(JapanUnqualifiedGoodsZh.class);
        util.exportExcel(response, list, "日本不合格商品展示-翻译数据");
    }

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

    /**
     * 新增日本不合格商品展示-翻译
     */
    @PreAuthorize("@ss.hasPermi('bus:japanzh:add')")
    @Log(title = "日本不合格商品展示-翻译", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody JapanUnqualifiedGoodsZh japanUnqualifiedGoodsZh)
    {
        return toAjax(japanUnqualifiedGoodsZhService.insertJapanUnqualifiedGoodsZh(japanUnqualifiedGoodsZh));
    }

    /**
     * 修改日本不合格商品展示-翻译
     */
    @PreAuthorize("@ss.hasPermi('bus:japanzh:edit')")
    @Log(title = "日本不合格商品展示-翻译", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JapanUnqualifiedGoodsZh japanUnqualifiedGoodsZh)
    {
        return toAjax(japanUnqualifiedGoodsZhService.updateJapanUnqualifiedGoodsZh(japanUnqualifiedGoodsZh));
    }

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