| | |
| | | import com.smartor.service.ITemplateDeptService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * @author lihu |
| | | * @date 2024-09-18 |
| | | */ |
| | | @Slf4j |
| | | @Api("模板科室关联") |
| | | @RestController |
| | | @RequestMapping("/smartor/td") |
| | | public class TemplateDeptController extends BaseController |
| | | { |
| | | public class TemplateDeptController extends BaseController { |
| | | @Autowired |
| | | private ITemplateDeptService templateDeptService; |
| | | |
| | |
| | | @ApiOperation("查询模板科室关联列表") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:dept:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TemplateDept templateDept) |
| | | { |
| | | public TableDataInfo list(TemplateDept templateDept) { |
| | | startPage(); |
| | | List<TemplateDept> list = templateDeptService.selectTemplateDeptList(templateDept); |
| | | return getDataTable(list); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:dept:export')") |
| | | @Log(title = "模板科室关联", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, TemplateDept templateDept) |
| | | { |
| | | public void export(HttpServletResponse response, TemplateDept templateDept) { |
| | | List<TemplateDept> list = templateDeptService.selectTemplateDeptList(templateDept); |
| | | ExcelUtil<TemplateDept> util = new ExcelUtil<TemplateDept>(TemplateDept.class); |
| | | util.exportExcel(response, list, "模板科室关联数据"); |
| | |
| | | @ApiOperation("获取模板科室关联详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:dept:query')") |
| | | @GetMapping(value = "/getInfo/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(templateDeptService.selectTemplateDeptById(id)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("新增模板科室关联") |
| | | @Log(title = "模板科室关联", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody List<TemplateDept> templateDepts) |
| | | { |
| | | public AjaxResult add(@RequestBody List<TemplateDept> templateDepts) { |
| | | return toAjax(templateDeptService.insertTemplateDept(templateDepts)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:dept:edit')") |
| | | @Log(title = "模板科室关联", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody TemplateDept templateDept) |
| | | { |
| | | public AjaxResult edit(@RequestBody TemplateDept templateDept) { |
| | | return toAjax(templateDeptService.updateTemplateDept(templateDept)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除模板科室关联") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:dept:remove')") |
| | | @Log(title = "模板科室关联", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(templateDeptService.deleteTemplateDeptByIds(ids)); |
| | | @GetMapping("/remove/{id}") |
| | | public AjaxResult remove(@PathVariable("id") Long id) { |
| | | log.error("删除的ID为:{}",id); |
| | | return toAjax(templateDeptService.deleteTemplateDeptById(id)); |
| | | } |
| | | } |