liusheng
2024-09-21 d3bf339bd64d7b7efddc0afdd4beb1866b8b5a04
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TemplateDeptController.java
@@ -10,6 +10,7 @@
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.*;
@@ -22,11 +23,11 @@
 * @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;
@@ -36,8 +37,7 @@
    @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);
@@ -50,8 +50,7 @@
    //@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, "模板科室关联数据");
@@ -63,8 +62,7 @@
    @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));
    }
@@ -75,8 +73,7 @@
    @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));
    }
@@ -87,8 +84,7 @@
    //@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));
    }
@@ -98,9 +94,9 @@
    @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));
    }
}