package cn.besteam.modules.system.controller; import cn.besteam.common.api.vo.Result; import cn.besteam.common.aspect.annotation.AutoLog; import cn.besteam.modules.system.vo.SysDepartmentOfficeVO; import cn.besteam.modules.system.service.ISysDepartmentService; import cn.besteam.modules.system.dto.SysDepartmentOfficeQueryDTO; import cn.besteam.modules.system.dto.SysDepartmentOfficeUpdateDTO; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** * @Description: 科室管理Controller * @author: besteam * @date: 2024-01-01 * @version: V1.0 */ @RestController @RequestMapping("/system/office") @Slf4j @Api(tags = "【0729迭代】科室管理") public class SysDepartmentOfficeController { @Autowired private ISysDepartmentService sysDepartmentService; /** * 科室列表分页查询 * * @param queryVO 查询条件 * @return 科室列表 */ @GetMapping(value = "/list") @ApiOperation(value = "科室列表分页查询", notes = "获取科室列表数据,支持医院选择和科室名称模糊查询") public Result> queryPageList( @ApiParam(value = "查询条件") SysDepartmentOfficeQueryDTO queryVO) { IPage pageList = sysDepartmentService.queryOfficePageList(queryVO); return Result.ok(pageList); } /** * 编辑科室信息 * * @param updateVO 更新数据 * @return 操作结果 */ @PostMapping(value = "/edit") @AutoLog(value = "编辑科室信息") @ApiOperation(value = "编辑科室信息", notes = "可修改科室名称、科室位置、床位数和产废阈值") public Result edit(@Validated @RequestBody SysDepartmentOfficeUpdateDTO updateVO) { boolean success = sysDepartmentService.updateOfficeInfo(updateVO); if (success) { return Result.ok("修改成功!"); } else { return Result.error("修改失败!"); } } }