package com.ruoyi.web.controller.smartor; 
 | 
  
 | 
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.domain.entity.SysUser; 
 | 
import com.ruoyi.common.core.page.TableDataInfo; 
 | 
import com.ruoyi.common.enums.BusinessType; 
 | 
import com.ruoyi.common.utils.PageUtils; 
 | 
import com.ruoyi.common.utils.poi.ExcelUtil; 
 | 
import com.smartor.domain.IvrLibaTargetoption; 
 | 
import com.smartor.service.IIvrLibaTargetoptionService; 
 | 
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 
 | 
 * 
 | 
 * @author ruoyi 
 | 
 * @date 2023-12-14 
 | 
 */ 
 | 
@Api(description = "指标选项库") 
 | 
@RestController 
 | 
@RequestMapping("/smartor/targetoption") 
 | 
public class IvrLibaTargetoptionController extends BaseController 
 | 
{ 
 | 
    @Autowired 
 | 
    private IIvrLibaTargetoptionService ivrLibaTargetoptionService; 
 | 
  
 | 
    /** 
 | 
     * 查询指标选项库列表 
 | 
     */ 
 | 
    @ApiOperation("查询指标选项库列表") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:list')") 
 | 
    @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody    IvrLibaTargetoption ivrLibaTargetoption) 
 | 
    { 
 | 
        PageUtils.startPageByPost(ivrLibaTargetoption.getPageNum(),ivrLibaTargetoption.getPageSize()); 
 | 
        List<IvrLibaTargetoption> list = ivrLibaTargetoptionService.selectIvrLibaTargetoptionList(ivrLibaTargetoption); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出指标选项库列表 
 | 
     */ 
 | 
    @ApiOperation("导出指标选项库列表") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:export')") 
 | 
    @Log(title = "指标选项库", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrLibaTargetoption ivrLibaTargetoption) 
 | 
    { 
 | 
        List<IvrLibaTargetoption> list = ivrLibaTargetoptionService.selectIvrLibaTargetoptionList(ivrLibaTargetoption); 
 | 
        ExcelUtil<IvrLibaTargetoption> util = new ExcelUtil<IvrLibaTargetoption>(IvrLibaTargetoption.class); 
 | 
        util.exportExcel(response, list, "指标选项库数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取指标选项库详细信息 
 | 
     */ 
 | 
    @ApiOperation("获取指标选项库详细信息") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:query')") 
 | 
    @GetMapping(value = "/getInfo/{targetoptionid}") 
 | 
    public AjaxResult getInfo(@PathVariable("targetoptionid") Long targetoptionid) 
 | 
    { 
 | 
        return success(ivrLibaTargetoptionService.selectIvrLibaTargetoptionByTargetoptionid(targetoptionid)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增指标选项库 
 | 
     */ 
 | 
    @ApiOperation("新增指标选项库") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:add')") 
 | 
    @Log(title = "指标选项库", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrLibaTargetoption ivrLibaTargetoption) 
 | 
    { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        ivrLibaTargetoption.setOrgid(user.getOrgid()); 
 | 
        return toAjax(ivrLibaTargetoptionService.insertIvrLibaTargetoption(ivrLibaTargetoption)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改指标选项库 
 | 
     */ 
 | 
    @ApiOperation("修改指标选项库") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:edit')") 
 | 
    @Log(title = "指标选项库", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrLibaTargetoption ivrLibaTargetoption) 
 | 
    { 
 | 
        return toAjax(ivrLibaTargetoptionService.updateIvrLibaTargetoption(ivrLibaTargetoption)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除指标选项库 
 | 
     */ 
 | 
    @ApiOperation("删除指标选项库") 
 | 
    //@PreAuthorize("@ss.hasPermi('system:targetoption:remove')") 
 | 
    @Log(title = "指标选项库", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{targetoptionids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] targetoptionids) 
 | 
    { 
 | 
        return toAjax(ivrLibaTargetoptionService.deleteIvrLibaTargetoptionByTargetoptionids(targetoptionids)); 
 | 
    } 
 | 
} 
 |