liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HeLibraryController.java
@@ -1,32 +1,24 @@
package com.ruoyi.web.controller.smartor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.HeLibrary;
import com.smartor.domain.HeLibraryVO;
import com.smartor.domain.IvrLibaTemplateVO;
import com.smartor.service.IHeLibraryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
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;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * 宣教资料库Controller
@@ -45,7 +37,7 @@
     * 查询宣教资料库列表
     */
    @ApiOperation("查询宣教资料库列表")
    @PreAuthorize("@ss.hasPermi('system:library:list')")
    //@PreAuthorize("@ss.hasPermi('system:library:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody HeLibrary heLibrary) {
        startPage();
@@ -56,7 +48,7 @@
    /**
     * 导出宣教资料库列表
     */
    @PreAuthorize("@ss.hasPermi('system:library:export')")
    //@PreAuthorize("@ss.hasPermi('system:library:export')")
    @Log(title = "宣教资料库", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, HeLibrary heLibrary) {
@@ -68,8 +60,8 @@
    /**
     * 获取宣教资料库详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:library:query')")
    @GetMapping(value = "/{id}")
    //@PreAuthorize("@ss.hasPermi('system:library:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(heLibraryService.selectHeLibraryById(id));
    }
@@ -77,9 +69,9 @@
    /**
     * 新增宣教资料库
     */
    @PreAuthorize("@ss.hasPermi('system:library:add')")
    //@PreAuthorize("@ss.hasPermi('system:library:add')")
    @Log(title = "宣教资料库", businessType = BusinessType.INSERT)
    @PostMapping
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HeLibrary heLibrary) {
        return toAjax(heLibraryService.insertHeLibrary(heLibrary));
    }
@@ -87,9 +79,9 @@
    /**
     * 修改宣教资料库
     */
    @PreAuthorize("@ss.hasPermi('system:library:edit')")
    //@PreAuthorize("@ss.hasPermi('system:library:edit')")
    @Log(title = "宣教资料库", businessType = BusinessType.UPDATE)
    @PutMapping
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HeLibrary heLibrary) {
        return toAjax(heLibraryService.updateHeLibrary(heLibrary));
    }
@@ -97,9 +89,10 @@
    /**
     * 删除宣教资料库
     */
    @PreAuthorize("@ss.hasPermi('system:library:remove')")
    @ApiOperation("删除宣教资料库")
    //@PreAuthorize("@ss.hasPermi('system:library:remove')")
    @Log(title = "宣教资料库", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(heLibraryService.deleteHeLibraryByIds(ids));
    }
@@ -108,9 +101,9 @@
     * 新增或修改宣教详情
     */
    @ApiOperation("新增或修改宣教详情")
    @PreAuthorize("@ss.hasPermi('system:script:list')")
    @PostMapping("/saveOrUpdateScript")
    public AjaxResult saveOrUpdateScript(@RequestBody HeLibraryVO heLibraryVO) {
    //@PreAuthorize("@ss.hasPermi('system:script:list')")
    @PostMapping("/saveOrUpdateHeLibrary")
    public AjaxResult saveOrUpdateHeLibrary(@RequestBody HeLibraryVO heLibraryVO) {
        if (ObjectUtils.isEmpty(heLibraryVO)) {
            throw new BaseException("入参为空,请检查入参");
        }