|
|
@@ -0,0 +1,80 @@
|
|
|
+package cn.tr.module.smart.web.controller;
|
|
|
+
|
|
|
+import cn.tr.core.pojo.TableDataInfo;
|
|
|
+import cn.tr.module.smart.common.dto.BizDeptDTO;
|
|
|
+import cn.tr.module.smart.common.dto.BizDeptQueryDTO;
|
|
|
+import cn.tr.module.smart.common.service.IBizDeptService;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.tr.core.validation.Insert;
|
|
|
+import cn.tr.core.validation.Update;
|
|
|
+import cn.tr.core.pojo.CommonResult;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import java.util.*;
|
|
|
+import cn.tr.plugin.mybatis.base.BaseController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import cn.tr.module.api.sys.log.annotation.OperateLog;
|
|
|
+/**
|
|
|
+ * 科室控制器
|
|
|
+ *
|
|
|
+ * @author lf
|
|
|
+ * @date 2025/06/04 14:09
|
|
|
+ */
|
|
|
+@Api(tags = "科室")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/biz/dept")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BizDeptController extends BaseController{
|
|
|
+
|
|
|
+ private final IBizDeptService bizDeptService;
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 1)
|
|
|
+ @ApiOperation(value="根据条件查询科室",notes = "权限: 无")
|
|
|
+ @PostMapping("/query/page")
|
|
|
+ public TableDataInfo<BizDeptDTO> selectList(@RequestBody BizDeptQueryDTO query) {
|
|
|
+ startPage();
|
|
|
+ return getDataTable(bizDeptService.selectBizDeptList(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 2)
|
|
|
+ @ApiOperation(value = "根据id查询科室",notes = "权限: biz:dept:query")
|
|
|
+ @GetMapping("/detail/{id}")
|
|
|
+ @SaCheckPermission("biz:dept:query")
|
|
|
+ public CommonResult<BizDeptDTO> findById(@PathVariable("id") String id){
|
|
|
+ return CommonResult.success(bizDeptService.selectBizDeptById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 3)
|
|
|
+ @ApiOperation(value="添加科室",notes = "权限: biz:dept:add")
|
|
|
+ @PostMapping("/add")
|
|
|
+ @OperateLog
|
|
|
+ @SaCheckPermission("biz:dept:add")
|
|
|
+ public CommonResult<Boolean> add(@RequestBody@Validated(Insert.class) BizDeptDTO source) {
|
|
|
+ return CommonResult.success(bizDeptService.insertBizDept(source));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 4)
|
|
|
+ @ApiOperation(value="通过主键id编辑科室",notes = "权限: biz:dept:edit")
|
|
|
+ @PostMapping("/edit")
|
|
|
+ @OperateLog
|
|
|
+ @SaCheckPermission("biz:dept:edit")
|
|
|
+ public CommonResult<Boolean> edit(@RequestBody@Validated(Update.class) BizDeptDTO source) {
|
|
|
+ return CommonResult.success(bizDeptService.updateBizDeptById(source));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 5)
|
|
|
+ @ApiOperation(value="删除科室",notes = "权限: biz:dept:remove")
|
|
|
+ @PostMapping("/removeByIds")
|
|
|
+ @OperateLog
|
|
|
+ @SaCheckPermission("biz:dept:remove")
|
|
|
+ public CommonResult<Integer> delete(@RequestBody Collection<String> ids) {
|
|
|
+ return CommonResult.success(bizDeptService.removeBizDeptByIds(ids));
|
|
|
+ }
|
|
|
+}
|