| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import cn.hutool.db.Page; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | 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.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.IvrLibaTarget; |
| | | import com.smartor.domain.IvrLibaTargetAssort; |
| | | import com.smartor.domain.IvrLibaTargetVO; |
| | | import com.smartor.service.IIvrLibaTargetService; |
| | | 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.*; |
| | |
| | | * @author ruoyi |
| | | * @date 2023-12-14 |
| | | */ |
| | | @Api(description = "指标库") |
| | | @RestController |
| | | @RequestMapping("/smartor/target") |
| | | public class IvrLibaTargetController extends BaseController { |
| | |
| | | /** |
| | | * 查询指标选项库列表 |
| | | */ |
| | | @ApiOperation("查询指标列表") |
| | | @PreAuthorize("@ss.hasPermi('system:target:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody IvrLibaTarget ivrLibaTarget) { |
| | | PageUtils.startPageByPost(ivrLibaTarget.getPageNum(),ivrLibaTarget.getPageSize()); |
| | | public TableDataInfo list(@RequestBody IvrLibaTarget ivrLibaTarget) { |
| | | PageUtils.startPageByPost(ivrLibaTarget.getPageNum(), ivrLibaTarget.getPageSize()); |
| | | List<IvrLibaTarget> list = ivrLibaTargetService.selectIvrLibaTargetList(ivrLibaTarget); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出指标选项库列表 |
| | | * 导出指标列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:target:export')") |
| | | @Log(title = "指标选项库", businessType = BusinessType.EXPORT) |
| | | @Log(title = "指标库", businessType = BusinessType.EXPORT) |
| | | @ApiOperation("导出指标列表") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, IvrLibaTarget ivrLibaTarget) { |
| | | List<IvrLibaTarget> list = ivrLibaTargetService.selectIvrLibaTargetList(ivrLibaTarget); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取指标选项库详细信息 |
| | | * 获取指标信息通过targetID |
| | | */ |
| | | @ApiOperation("获取指标信息通过targetID") |
| | | @PreAuthorize("@ss.hasPermi('system:target:query')") |
| | | @GetMapping(value = "/getInfo/{targetID}") |
| | | public AjaxResult getInfo(@PathVariable("targetID") Long targetID) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增指标选项库 |
| | | * 新增指标 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:target:add')") |
| | | @Log(title = "指标选项库", businessType = BusinessType.INSERT) |
| | | @ApiOperation("新增指标(这个接口没啥用了,用”新增或修改指标信息“这个接口好一些)") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody IvrLibaTarget ivrLibaTarget) { |
| | | return toAjax(ivrLibaTargetService.insertIvrLibaTarget(ivrLibaTarget)); |
| | | public AjaxResult add(@RequestBody IvrLibaTargetVO ivrLibaTargetVO) { |
| | | return toAjax(ivrLibaTargetService.insertIvrLibaTarget(ivrLibaTargetVO)); |
| | | } |
| | | |
| | | /** |
| | | * 修改指标选项库 |
| | | * 新增或修改指标信息 |
| | | */ |
| | | @ApiOperation("新增或修改指标信息") |
| | | @PreAuthorize("@ss.hasPermi('system:target:edit')") |
| | | @Log(title = "指标选项库", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody IvrLibaTarget ivrLibaTarget) { |
| | | return toAjax(ivrLibaTargetService.updateIvrLibaTarget(ivrLibaTarget)); |
| | | @PostMapping("/saveOrupdateIvrLibaTarget") |
| | | public AjaxResult saveOrupdateIvrLibaTarget(@RequestBody IvrLibaTargetVO ivrLibaTargetVO) { |
| | | return toAjax(ivrLibaTargetService.saveOrupdateIvrLibaTarget(ivrLibaTargetVO)); |
| | | } |
| | | |
| | | /** |
| | | * 删除指标选项库 |
| | | * 删除指标 |
| | | */ |
| | | @ApiOperation("删除指标") |
| | | @PreAuthorize("@ss.hasPermi('system:target:remove')") |
| | | @Log(title = "指标选项库", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{targetIDs}") |
| | | public AjaxResult remove(@PathVariable Long[] targetIDs) { |
| | | return toAjax(ivrLibaTargetService.deleteIvrLibaTargetByTargetIDs(targetIDs)); |
| | | } |
| | | |
| | | /** |
| | | * 查询指标选项库列表 |
| | | */ |
| | | @ApiOperation("查询指标和关联的指标选项") |
| | | @PreAuthorize("@ss.hasPermi('system:target:list')") |
| | | @PostMapping("/targetInfo") |
| | | public TableDataInfo targetInfo(@RequestBody IvrLibaTarget ivrLibaTarget) { |
| | | PageUtils.startPageByPost(ivrLibaTarget.getPageNum(), ivrLibaTarget.getPageSize()); |
| | | //这个用来获取分页数据 |
| | | List<IvrLibaTargetVO> ivrLibaTargetVOS = ivrLibaTargetService.targetInfo(ivrLibaTarget); |
| | | |
| | | //用于分页 |
| | | List<IvrLibaTarget> ivrLibaTargets = ivrLibaTargetService.selectIvrLibaTargetList(null); |
| | | //分页 |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(ivrLibaTargetVOS); |
| | | rspData.setTotal(new PageInfo(ivrLibaTargets).getTotal()); |
| | | |
| | | return rspData; |
| | | } |
| | | } |