|  |  |  | 
|---|
|  |  |  | package com.ruoyi.web.controller.smartor; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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.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.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.smartor.domain.IvrLibaExtemplate; | 
|---|
|  |  |  | import com.smartor.service.IIvrLibaExtemplateService; | 
|---|
|  |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 扩展话术模板库Controller | 
|---|
|  |  |  | * 通过模板Controller | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @author smartor | 
|---|
|  |  |  | * @date 2023-03-22 | 
|---|
|  |  |  | * @author ruoyi | 
|---|
|  |  |  | * @date 2023-12-27 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Api(description = "通过模板") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/smartor/ivrextemplate") | 
|---|
|  |  |  | @RequestMapping("/smartor/extemplate") | 
|---|
|  |  |  | public class IvrLibaExtemplateController extends BaseController { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IIvrLibaExtemplateService ivrLibaExtemplateService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询扩展话术模板库列表 | 
|---|
|  |  |  | * 查询通过模板列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:list')") | 
|---|
|  |  |  | @ApiOperation("查询通过模板列表") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:list')") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | public TableDataInfo list(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { | 
|---|
|  |  |  | startPage(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 导出扩展话术模板库列表 | 
|---|
|  |  |  | * 导出通过模板列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:export')") | 
|---|
|  |  |  | @Log(title = "扩展话术模板库", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @ApiOperation("导出通过模板列表") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:export')") | 
|---|
|  |  |  | @Log(title = "通过模板", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @PostMapping("/export") | 
|---|
|  |  |  | public void export(HttpServletResponse response, IvrLibaExtemplate ivrLibaExtemplate) { | 
|---|
|  |  |  | List<IvrLibaExtemplate> list = ivrLibaExtemplateService.selectIvrLibaExtemplateList(ivrLibaExtemplate); | 
|---|
|  |  |  | ExcelUtil<IvrLibaExtemplate> util = new ExcelUtil<IvrLibaExtemplate>(IvrLibaExtemplate.class); | 
|---|
|  |  |  | util.exportExcel(response, list, "扩展话术模板库数据"); | 
|---|
|  |  |  | util.exportExcel(response, list, "通过模板数据"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取扩展话术模板库详细信息 | 
|---|
|  |  |  | * 获取通过模板详细信息 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:query')") | 
|---|
|  |  |  | @GetMapping(value = "/{subModuleID}") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("subModuleID") String subModuleID) { | 
|---|
|  |  |  | return success(ivrLibaExtemplateService.selectIvrLibaExtemplateBySubModuleID(subModuleID)); | 
|---|
|  |  |  | @ApiOperation("获取通过模板详细信息") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:query')") | 
|---|
|  |  |  | @GetMapping(value = "/{ID}") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("ID") String ID) { | 
|---|
|  |  |  | return success(ivrLibaExtemplateService.selectIvrLibaExtemplateByID(ID)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 新增扩展话术模板库 | 
|---|
|  |  |  | * 新增通过模板 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:add')") | 
|---|
|  |  |  | @Log(title = "扩展话术模板库", businessType = BusinessType.INSERT) | 
|---|
|  |  |  | @ApiOperation("新增通过模板") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:add')") | 
|---|
|  |  |  | @Log(title = "通过模板", businessType = BusinessType.INSERT) | 
|---|
|  |  |  | @PostMapping("/add") | 
|---|
|  |  |  | public AjaxResult add(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { | 
|---|
|  |  |  | return toAjax(ivrLibaExtemplateService.insertIvrLibaExtemplate(ivrLibaExtemplate)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 修改扩展话术模板库 | 
|---|
|  |  |  | * 修改通过模板 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:edit')") | 
|---|
|  |  |  | @Log(title = "扩展话术模板库", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @ApiOperation("修改通过模板") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:edit')") | 
|---|
|  |  |  | @Log(title = "通过模板", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @PostMapping("/edit") | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { | 
|---|
|  |  |  | return toAjax(ivrLibaExtemplateService.updateIvrLibaExtemplate(ivrLibaExtemplate)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除扩展话术模板库 | 
|---|
|  |  |  | * 删除通过模板 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:remove')") | 
|---|
|  |  |  | @Log(title = "扩展话术模板库", businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @GetMapping("/remove/{subModuleIDs}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable String[] subModuleIDs) { | 
|---|
|  |  |  | return toAjax(ivrLibaExtemplateService.deleteIvrLibaExtemplateBySubModuleIDs(subModuleIDs)); | 
|---|
|  |  |  | @ApiOperation("删除通过模板") | 
|---|
|  |  |  | @PreAuthorize("@ss.hasPermi('smartor:extemplate:remove')") | 
|---|
|  |  |  | @Log(title = "通过模板", businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @GetMapping("/remove/{IDs}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable String[] IDs) { | 
|---|
|  |  |  | return toAjax(ivrLibaExtemplateService.deleteIvrLibaExtemplateByIDs(IDs)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|