| | |
| | | package cn.lihu.jh.module.ecg.controller.admin.checktype; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | |
| | | import jakarta.validation.constraints.*; |
| | | import jakarta.validation.*; |
| | | import jakarta.servlet.http.*; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | |
| | |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; |
| | | import cn.lihu.jh.module.ecg.service.checktype.CheckTypeService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.annotation.security.PermitAll; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | @Tag(name = "管理后台 - 检查类型") |
| | | @RestController |
| | | @RequestMapping("/ecg/check-type") |
| | |
| | | @Resource |
| | | private CheckTypeService checkTypeService; |
| | | |
| | | /** 【本次加固】检查项目改动后刷新排队模块的检查项目缓存(亲和项、候诊上限等),改完不用重启服务 */ |
| | | @Resource |
| | | private cn.lihu.jh.module.ecg.service.queue.QueueService queueService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建检查类型") |
| | | @PreAuthorize("@ss.hasPermission('ecg:check-type:create')") |
| | | public CommonResult<Integer> createCheckType(@Valid @RequestBody CheckTypeSaveReqVO createReqVO) { |
| | | return success(checkTypeService.createCheckType(createReqVO)); |
| | | Integer id = checkTypeService.createCheckType(createReqVO); |
| | | queueService.initCheckType(); |
| | | return success(id); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | |
| | | @PreAuthorize("@ss.hasPermission('ecg:check-type:update')") |
| | | public CommonResult<Boolean> updateCheckType(@Valid @RequestBody CheckTypeSaveReqVO updateReqVO) { |
| | | checkTypeService.updateCheckType(updateReqVO); |
| | | queueService.initCheckType(); |
| | | return success(true); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermission('ecg:check-type:delete')") |
| | | public CommonResult<Boolean> deleteCheckType(@RequestParam("id") Integer id) { |
| | | checkTypeService.deleteCheckType(id); |
| | | queueService.initCheckType(); |
| | | return success(true); |
| | | } |
| | | |