| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.SvyTaskScript; |
| | | import com.smartor.service.ISvyTaskScriptService; |
| | | 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 2024-06-12 |
| | | */ |
| | | @Api(description = "任务问卷题目") |
| | | @RestController |
| | | @RequestMapping("/smartor/svyTaskScript") |
| | | public class SvyTaskScriptController extends BaseController |
| | | { |
| | | public class SvyTaskScriptController extends BaseController { |
| | | @Autowired |
| | | private ISvyTaskScriptService svyTaskScriptService; |
| | | |
| | | /** |
| | | * 查询任务问卷题目列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @ApiOperation("查询任务问卷题目列表") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SvyTaskScript svyTaskScript) |
| | | { |
| | | public TableDataInfo list(SvyTaskScript svyTaskScript) { |
| | | startPage(); |
| | | List<SvyTaskScript> list = svyTaskScriptService.selectSvyTaskScriptList(svyTaskScript); |
| | | return getDataTable(list); |
| | |
| | | /** |
| | | * 导出任务问卷题目列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:export')") |
| | | @ApiOperation("导出任务问卷题目列表") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:export')") |
| | | @Log(title = "任务问卷题目", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SvyTaskScript svyTaskScript) |
| | | { |
| | | public void export(HttpServletResponse response, SvyTaskScript svyTaskScript) { |
| | | List<SvyTaskScript> list = svyTaskScriptService.selectSvyTaskScriptList(svyTaskScript); |
| | | ExcelUtil<SvyTaskScript> util = new ExcelUtil<SvyTaskScript>(SvyTaskScript.class); |
| | | util.exportExcel(response, list, "任务问卷题目数据"); |
| | |
| | | /** |
| | | * 获取任务问卷题目详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:query')") |
| | | @ApiOperation("获取任务问卷题目详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(svyTaskScriptService.selectSvyTaskScriptById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增任务问卷题目 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:add')") |
| | | @ApiOperation("新增任务问卷题目") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:add')") |
| | | @Log(title = "任务问卷题目", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SvyTaskScript svyTaskScript) |
| | | { |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SvyTaskScript svyTaskScript) { |
| | | return toAjax(svyTaskScriptService.insertSvyTaskScript(svyTaskScript)); |
| | | } |
| | | |
| | | /** |
| | | * 修改任务问卷题目 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:edit')") |
| | | @ApiOperation("修改任务问卷题目") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:edit')") |
| | | @Log(title = "任务问卷题目", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody SvyTaskScript svyTaskScript) |
| | | { |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SvyTaskScript svyTaskScript) { |
| | | return toAjax(svyTaskScriptService.updateSvyTaskScript(svyTaskScript)); |
| | | } |
| | | |
| | | /** |
| | | * 删除任务问卷题目 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:script:remove')") |
| | | @ApiOperation("导出综合问卷任务(任务)列表") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:remove')") |
| | | @Log(title = "任务问卷题目", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(svyTaskScriptService.deleteSvyTaskScriptByIds(ids)); |
| | | } |
| | | } |