| | |
| | | |
| | | 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.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.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | 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("查询问卷列表详情") |
| | | @PostMapping("/selectSvyLibTemplatelist") |
| | | public TableDataInfo selectSvyLibTemplatelist(@RequestBody SvyLibTemplateReq svyLibTemplateReq) { |
| | | startPage(); |
| | | PageUtils.startPageByPost(svyLibTemplateReq.getPageNum(), svyLibTemplateReq.getPageSize()); |
| | | List<SvyLibTemplate> list = svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | return getDataTable(list); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | // |
| | |
| | | // 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)); |
| | | // } |
| | | |
| | | /** |
| | | * 新增或修改问卷模板信息 |