| | |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.github.pagehelper.ISelect; |
| | | 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.BaseEntity; |
| | | 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.PageUtils; |
| | | import com.smartor.domain.SvyLibScriptTag; |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | import com.smartor.domain.SvyLibTemplateVO; |
| | | import com.smartor.service.ISvyLibTemplateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | */ |
| | | @Api(description = "问卷模板") |
| | | @RestController |
| | | @RequestMapping("/smartor/svyTemplate") |
| | | @RequestMapping("/smartor/svyLibTemplate") |
| | | public class SvyLibTemplateController extends BaseController { |
| | | @Autowired |
| | | private ISvyLibTemplateService svyLibTemplateService; |
| | | |
| | | @ApiOperation("查询问卷列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo selectSvyLibTemplatelist(SvyLibTemplate svyLibTemplate) { |
| | | startPage(); |
| | | List<SvyLibTemplate> sviLibTemplate = svyLibTemplateService.getSviLibTemplate(svyLibTemplate); |
| | | return getDataTable(sviLibTemplate); |
| | | } |
| | | |
| | | /** |
| | | * 查询问卷列表 |
| | | */ |
| | | @ApiOperation("查询问卷列表详情") |
| | | @ApiOperation("查询问卷详情") |
| | | @PostMapping("/selectSvyLibTemplatelist") |
| | | public TableDataInfo selectSvyLibTemplatelist(@RequestBody SvyLibTemplateReq svyLibTemplateReq) { |
| | | startPage(); |
| | | List<SvyLibTemplate> list = svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | return getDataTable(list); |
| | | PageUtils.startPageByPost(svyLibTemplateReq.getPageNum(), svyLibTemplateReq.getPageSize()); |
| | | List<SvyLibTemplateVO> list = svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | //获取total |
| | | long total = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | svyLibTemplateReq.setPageNum(null); |
| | | svyLibTemplateReq.setPageSize(null); |
| | | svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | } |
| | | }); |
| | | |
| | | return getDataTable2(total, list); |
| | | } |
| | | return getDataTable2(0, list); |
| | | } |
| | | |
| | | // |
| | |
| | | // * 获取问卷详细信息(单表) |
| | | // */ |
| | | // @ApiOperation("获取问卷详细信息") |
| | | // @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:query')") |
| | | // //@PreAuthorize("@ss.hasPermi('smartor:svyTemplate:query')") |
| | | // @GetMapping(value = "/{svyid}") |
| | | // public AjaxResult getInfo(@PathVariable("svyid") Long svyid) { |
| | | // return success(svyLibTemplateService.selectSvyLibTemplateBySvyid(svyid)); |
| | | // } |
| | | |
| | | /** |
| | | * 新增问卷 |
| | | */ |
| | | @ApiOperation("新增问卷") |
| | | @PostMapping("/addSvyLibTemplate") |
| | | public AjaxResult addSvyLibTemplate(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | return toAjax(svyLibTemplateService.insertSvyLibTemplate(svyLibTemplate)); |
| | | } |
| | | // /** |
| | | // * 新增问卷 |
| | | // */ |
| | | // @ApiOperation("新增问卷") |
| | | // @PostMapping("/addSvyLibTemplate") |
| | | // public AjaxResult addSvyLibTemplate(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | // return toAjax(svyLibTemplateService.insertSvyLibTemplate(svyLibTemplate)); |
| | | // } |
| | | |
| | | /** |
| | | * 新增或修改问卷模板信息 |
| | | */ |
| | | @ApiOperation("新增或修改问卷模板信息") |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | //@PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @PostMapping("/saveOrUpdateTemplate") |
| | | public AjaxResult saveOrUpdateTemplate(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | if (ObjectUtils.isEmpty(svyLibTemplate)) { |
| | | public AjaxResult saveOrUpdateTemplate(@RequestBody SvyLibTemplateVO svyLibTemplateVO) { |
| | | if (ObjectUtils.isEmpty(svyLibTemplateVO)) { |
| | | throw new BaseException("入参为空,请检查入参"); |
| | | } |
| | | return success(svyLibTemplateService.saveOrUpdateTemplate(svyLibTemplate)); |
| | | return success(svyLibTemplateService.saveOrUpdateTemplate(svyLibTemplateVO)); |
| | | } |
| | | |
| | | /** |
| | | * 修改问卷 |
| | | */ |
| | | @ApiOperation("修改问卷") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:svyTemplate:edit')") |
| | | @Log(title = "问卷", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | |
| | | * 删除问卷 |
| | | */ |
| | | @ApiOperation("删除问卷") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | @Log(title = "问卷", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{svyids}") |
| | | public AjaxResult remove(@PathVariable Long[] svyids) { |
| | |
| | | * 发送短信 |
| | | */ |
| | | @ApiOperation("发送短信") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | @Log(title = "问卷", businessType = BusinessType.DELETE) |
| | | @PostMapping("/sendMessage") |
| | | public AjaxResult sendMessage(@PathVariable Long[] svyids) { |