| | |
| | | package com.smartor.controller; |
| | | 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.enums.BusinessType; |
| | | import com.smartor.domain.IvrLibaScript; |
| | | import com.smartor.service.IIvrLibaScriptService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | 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.IvrLibaScript; |
| | | import com.smartor.domain.IvrLibaScriptVO; |
| | | import com.smartor.service.IIvrLibaScriptService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | 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 |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-22 |
| | | * 问题话术库Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-12-21 |
| | | */ |
| | | @Api(description = "问题话术库") |
| | | @RestController |
| | | @RequestMapping("/smartor/ivrlibascript") |
| | | public class IvrLibaScriptController extends BaseController |
| | | { |
| | | @RequestMapping("/smartor/script") |
| | | public class IvrLibaScriptController extends BaseController { |
| | | @Autowired |
| | | private IIvrLibaScriptService ivrLibaScriptService; |
| | | |
| | | /** |
| | | * 查询话术库列表 |
| | | * 查询问题话术库列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody IvrLibaScript ivrLibaScript) |
| | | { |
| | | @ApiOperation("查询问题话术库列表") |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody IvrLibaScript ivrLibaScript) { |
| | | startPage(); |
| | | List<IvrLibaScript> list = ivrLibaScriptService.selectIvrLibaScriptList(ivrLibaScript); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出话术库列表 |
| | | * 导出问题话术库列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:export')") |
| | | @Log(title = "话术库", businessType = BusinessType.EXPORT) |
| | | @ApiOperation("导出问题话术库列表") |
| | | @PreAuthorize("@ss.hasPermi('system:script:export')") |
| | | @Log(title = "问题话术库", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, IvrLibaScript ivrLibaScript) |
| | | { |
| | | public void export(HttpServletResponse response, IvrLibaScript ivrLibaScript) { |
| | | List<IvrLibaScript> list = ivrLibaScriptService.selectIvrLibaScriptList(ivrLibaScript); |
| | | ExcelUtil<IvrLibaScript> util = new ExcelUtil<IvrLibaScript>(IvrLibaScript.class); |
| | | util.exportExcel(response, list, "话术库数据"); |
| | | util.exportExcel(response, list, "问题话术库数据"); |
| | | } |
| | | |
| | | /** |
| | | * 获取话术库详细信息 |
| | | * 获取问题话术库详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:query')") |
| | | @GetMapping(value = "/{questionid}") |
| | | public AjaxResult getInfo(@PathVariable("questionid") String questionid) |
| | | { |
| | | @ApiOperation("获取问题话术库详细信息") |
| | | @PreAuthorize("@ss.hasPermi('system:script:query')") |
| | | @GetMapping(value = "/getInfo/{questionid}") |
| | | public AjaxResult getInfo(@PathVariable("questionid") String questionid) { |
| | | return success(ivrLibaScriptService.selectIvrLibaScriptByQuestionid(questionid)); |
| | | } |
| | | |
| | | /** |
| | | * 新增话术库 |
| | | * 新增问题话术库 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:add')") |
| | | @Log(title = "话术库", businessType = BusinessType.INSERT) |
| | | @ApiOperation("新增问题话术库") |
| | | @PreAuthorize("@ss.hasPermi('system:script:add')") |
| | | @Log(title = "问题话术库", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody IvrLibaScript ivrLibaScript) |
| | | { |
| | | public AjaxResult add(@RequestBody IvrLibaScript ivrLibaScript) { |
| | | return toAjax(ivrLibaScriptService.insertIvrLibaScript(ivrLibaScript)); |
| | | } |
| | | |
| | | /** |
| | | * 修改话术库 |
| | | * 修改问题话术库 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:edit')") |
| | | @Log(title = "话术库", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("修改问题话术库") |
| | | @PreAuthorize("@ss.hasPermi('system:script:edit')") |
| | | @Log(title = "问题话术库", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody IvrLibaScript ivrLibaScript) |
| | | { |
| | | public AjaxResult edit(@RequestBody IvrLibaScript ivrLibaScript) { |
| | | return toAjax(ivrLibaScriptService.updateIvrLibaScript(ivrLibaScript)); |
| | | } |
| | | |
| | | /** |
| | | * 删除话术库 |
| | | * 删除问题话术库 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:ivrlibascript:remove')") |
| | | @Log(title = "话术库", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{questionids}") |
| | | public AjaxResult remove(@PathVariable String[] questionids) |
| | | { |
| | | @ApiOperation("删除问题话术库") |
| | | @PreAuthorize("@ss.hasPermi('system:script:remove')") |
| | | @Log(title = "问题话术库", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{questionids}") |
| | | public AjaxResult remove(@PathVariable String[] questionids) { |
| | | return toAjax(ivrLibaScriptService.deleteIvrLibaScriptByQuestionids(questionids)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询问题话术详情根据条件 |
| | | */ |
| | | @ApiOperation("查询问题话术详情根据条件") |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @PostMapping("/selectInfoByCondition") |
| | | public AjaxResult selectInfoByCondition(@RequestBody IvrLibaScriptVO ivrLibaScriptVO) { |
| | | if (ObjectUtils.isEmpty(ivrLibaScriptVO)) { |
| | | throw new BaseException("入参为空,请检查入参"); |
| | | } |
| | | startPage(); |
| | | IvrLibaScriptVO ivrLibaScriptVO1 = ivrLibaScriptService.selectInfoByCondition(ivrLibaScriptVO); |
| | | return success(ivrLibaScriptVO1); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改问题详情 |
| | | */ |
| | | @ApiOperation("新增或修改问题详情") |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @PostMapping("/saveOrUpdateScript") |
| | | public AjaxResult saveOrUpdateScript(@RequestBody IvrLibaScriptVO ivrLibaScriptVO) { |
| | | if (ObjectUtils.isEmpty(ivrLibaScriptVO)) { |
| | | throw new BaseException("入参为空,请检查入参"); |
| | | } |
| | | return success(ivrLibaScriptService.saveOrUpdateScript(ivrLibaScriptVO)); |
| | | } |
| | | |
| | | } |