liusheng
2024-11-29 8d913e5594f45ca2a4ce656ea9feb99ffe715913
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.SendTaskVO;
import com.smartor.domain.SvyTaskTemplate;
import com.smartor.domain.SvyTaskTemplateVO;
import com.smartor.service.ISvyTaskTemplateService;
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 2024-06-12
 */
@Api(description = "任务问卷模板")
@RestController
@RequestMapping("/smartor/svytemplateTask")
public class SvyTaskTemplateController extends BaseController {
    @Autowired
    private ISvyTaskTemplateService svyTaskTemplateService;
 
    /**
     * 查询任务问卷模板列表
     */
    //@PreAuthorize("@ss.hasPermi('system:template:list')")
    @ApiOperation("查询任务问卷模板列表")
    @GetMapping("/list")
    public TableDataInfo list(SvyTaskTemplate svyTaskTemplate) {
        startPage();
        List<SvyTaskTemplate> list = svyTaskTemplateService.selectSvyTaskTemplateList(svyTaskTemplate);
        return getDataTable(list);
    }
 
    /**
     * 导出任务问卷模板列表
     */
    @ApiOperation("导出任务问卷模板列表")
    //@PreAuthorize("@ss.hasPermi('system:template:export')")
    @Log(title = "任务问卷模板", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SvyTaskTemplate svyTaskTemplate) {
        List<SvyTaskTemplate> list = svyTaskTemplateService.selectSvyTaskTemplateList(svyTaskTemplate);
        ExcelUtil<SvyTaskTemplate> util = new ExcelUtil<SvyTaskTemplate>(SvyTaskTemplate.class);
        util.exportExcel(response, list, "任务问卷模板数据");
    }
 
    /**
     * 获取任务问卷模板详细信息
     */
    @ApiOperation("获取任务问卷模板详细信息")
    //@PreAuthorize("@ss.hasPermi('system:template:query')")
    @GetMapping(value = "/{svyid}")
    public AjaxResult getInfo(@PathVariable("svyid") Long svyid) {
        return success(svyTaskTemplateService.selectSvyTaskTemplateBySvyid(svyid));
    }
 
    /**
     * 新增任务问卷模板
     */
    @ApiOperation("新增任务问卷模板")
    //@PreAuthorize("@ss.hasPermi('system:template:add')")
    @Log(title = "任务问卷模板", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SvyTaskTemplate svyTaskTemplate) {
        return toAjax(svyTaskTemplateService.insertSvyTaskTemplate(svyTaskTemplate));
    }
 
    /**
     * 修改任务问卷模板
     */
    @ApiOperation("修改任务问卷模板")
    //@PreAuthorize("@ss.hasPermi('system:template:edit')")
    @Log(title = "任务问卷模板", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody SvyTaskTemplate svyTaskTemplate) {
        return toAjax(svyTaskTemplateService.updateSvyTaskTemplate(svyTaskTemplate));
    }
 
    /**
     * 删除任务问卷模板
     */
    @ApiOperation("删除任务问卷模板")
    //@PreAuthorize("@ss.hasPermi('system:template:remove')")
    @Log(title = "任务问卷模板", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{svyids}")
    public AjaxResult remove(@PathVariable Long[] svyids) {
        return toAjax(svyTaskTemplateService.deleteSvyTaskTemplateBySvyids(svyids));
    }
 
    /**
     * 新增或修改随访任务问卷模板库
     */
    //@PreAuthorize("@ss.hasPermi('system:template:add')")
    @ApiOperation("新增或修改随访任务问卷模板库")
    @PostMapping("/saveOrUpdateTaskTemp")
    public AjaxResult saveOrUpdateTaskTemp(@RequestBody SvyTaskTemplateVO svyTaskTemplateVO) {
        return AjaxResult.success(svyTaskTemplateService.saveOrUpdateTemplate(svyTaskTemplateVO));
    }
 
    /**
     * 查询模板详情根据条件
     *
     * @param svyTaskTemplateVO
     * @return
     */
    //@PreAuthorize("@ss.hasPermi('system:template:add')")
    @ApiOperation("查询模板详情根据条件")
    @PostMapping("/selectInfoByCondition")
    public AjaxResult selectInfoByCondition(@RequestBody SvyTaskTemplateVO svyTaskTemplateVO) {
        return AjaxResult.success(svyTaskTemplateService.selectInfoByCondition(svyTaskTemplateVO));
    }
 
}