| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/smartor/smstemplet") |
| | | public class SmsTempletController extends BaseController |
| | | { |
| | | public class SmsTempletController extends BaseController { |
| | | @Autowired |
| | | private ISmsTempletService smsTempletService; |
| | | |
| | |
| | | * 查询短信模板列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody SmsTemplet smsTemplet) |
| | | { |
| | | startPage(); |
| | | @PostMapping("/list") |
| | | public Map<String, Object> list(@RequestBody SmsTemplet smsTemplet) { |
| | | //这个不需要分页,一个科室也不会有多少条短信模板 |
| | | smsTemplet.setPageNum(null); |
| | | smsTemplet.setPageSize(null); |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | return getDataTable(list); |
| | | return getDataTable3(ObjectUtil.isNotEmpty(list)?list.size():0, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:export')") |
| | | @Log(title = "短信模板", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SmsTemplet smsTemplet) |
| | | { |
| | | public void export(HttpServletResponse response, SmsTemplet smsTemplet) { |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | ExcelUtil<SmsTemplet> util = new ExcelUtil<SmsTemplet>(SmsTemplet.class); |
| | | util.exportExcel(response, list, "短信模板数据"); |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:query')") |
| | | @GetMapping(value = "/{templetid}") |
| | | public AjaxResult getInfo(@PathVariable("templetid") Long templetid) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("templetid") Long templetid) { |
| | | return success(smsTempletService.selectSmsTempletByTempletid(templetid)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:add')") |
| | | @Log(title = "短信模板", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SmsTemplet smsTemplet) |
| | | { |
| | | public AjaxResult add(@RequestBody SmsTemplet smsTemplet) { |
| | | return toAjax(smsTempletService.insertSmsTemplet(smsTemplet)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:edit')") |
| | | @Log(title = "短信模板", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SmsTemplet smsTemplet) |
| | | { |
| | | public AjaxResult edit(@RequestBody SmsTemplet smsTemplet) { |
| | | return toAjax(smsTempletService.updateSmsTemplet(smsTemplet)); |
| | | } |
| | | |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:remove')") |
| | | @Log(title = "短信模板", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{templetids}") |
| | | public AjaxResult remove(@PathVariable Long[] templetids) |
| | | { |
| | | @GetMapping("/remove/{templetids}") |
| | | public AjaxResult remove(@PathVariable Long[] templetids) { |
| | | return toAjax(smsTempletService.deleteSmsTempletByTempletids(templetids)); |
| | | } |
| | | } |