科室ID改成Integer

This commit is contained in:
lxd 2025-02-13 16:30:15 +08:00
parent 1ec2b6e5af
commit 88ee4b4279
6 changed files with 11 additions and 11 deletions

View File

@ -55,7 +55,7 @@ public class InspectDepartmentController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除科室") @Operation(summary = "删除科室")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteDepartment(@RequestParam("id") String id) { public CommonResult<Boolean> deleteDepartment(@RequestParam("id") Integer id) {
departmentService.deleteDepartment(id); departmentService.deleteDepartment(id);
return success(true); return success(true);
} }
@ -63,7 +63,7 @@ public class InspectDepartmentController {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得科室") @Operation(summary = "获得科室")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<InspectDepartmentRespVO> getDepartment(@RequestParam("id") String id) { public CommonResult<InspectDepartmentRespVO> getDepartment(@RequestParam("id") Integer id) {
InspectDepartmentDO department = departmentService.getDepartment(id); InspectDepartmentDO department = departmentService.getDepartment(id);
return success(BeanUtils.toBean(department, InspectDepartmentRespVO.class)); return success(BeanUtils.toBean(department, InspectDepartmentRespVO.class));
} }

View File

@ -14,7 +14,7 @@ public class InspectDepartmentRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19890") @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19890")
@ExcelProperty("主键") @ExcelProperty("主键")
private String id; private Integer id;
@Schema(description = "科室名称", example = "王五") @Schema(description = "科室名称", example = "王五")
@ExcelProperty("科室名称") @ExcelProperty("科室名称")

View File

@ -13,7 +13,7 @@ import java.time.LocalDateTime;
public class InspectDepartmentSaveReqVO { public class InspectDepartmentSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19890") @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19890")
private String id; private Integer id;
@Schema(description = "科室名称", example = "王五") @Schema(description = "科室名称", example = "王五")
private String departmentName; private String departmentName;

View File

@ -25,7 +25,7 @@ public class InspectDepartmentDO {
* 主键 * 主键
*/ */
@TableId(type = IdType.INPUT) @TableId(type = IdType.INPUT)
private String id; private Integer id;
/** /**
* 科室名称 * 科室名称
*/ */

View File

@ -35,7 +35,7 @@ public interface InspectDepartmentService {
* *
* @param id 编号 * @param id 编号
*/ */
void deleteDepartment(String id); void deleteDepartment(Integer id);
/** /**
* 获得科室 * 获得科室
@ -43,7 +43,7 @@ public interface InspectDepartmentService {
* @param id 编号 * @param id 编号
* @return 科室 * @return 科室
*/ */
InspectDepartmentDO getDepartment(String id); InspectDepartmentDO getDepartment(Integer id);
/** /**
* 获得科室分页 * 获得科室分页

View File

@ -37,7 +37,7 @@ public class InspectDepartmentServiceImpl implements InspectDepartmentService {
InspectDepartmentDO department = BeanUtils.toBean(createReqVO, InspectDepartmentDO.class); InspectDepartmentDO department = BeanUtils.toBean(createReqVO, InspectDepartmentDO.class);
departmentMapper.insert(department); departmentMapper.insert(department);
// 返回 // 返回
return department.getId(); return String.valueOf(department.getId());
} }
@Override @Override
@ -50,21 +50,21 @@ public class InspectDepartmentServiceImpl implements InspectDepartmentService {
} }
@Override @Override
public void deleteDepartment(String id) { public void deleteDepartment(Integer id) {
// 校验存在 // 校验存在
validateDepartmentExists(id); validateDepartmentExists(id);
// 删除 // 删除
departmentMapper.deleteById(id); departmentMapper.deleteById(id);
} }
private void validateDepartmentExists(String id) { private void validateDepartmentExists(Integer id) {
if (departmentMapper.selectById(id) == null) { if (departmentMapper.selectById(id) == null) {
} }
} }
@Override @Override
public InspectDepartmentDO getDepartment(String id) { public InspectDepartmentDO getDepartment(Integer id) {
return departmentMapper.selectById(id); return departmentMapper.selectById(id);
} }