eight
2024-08-23 f696df5ce36beb3af261bae782fa0a418b83b9e6
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/queueController.java
@@ -1,5 +1,6 @@
package cn.lihu.jh.module.ecg.controller.admin.queue;
import cn.lihu.jh.framework.common.exception.ErrorCode;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -14,6 +15,8 @@
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
@@ -92,4 +95,36 @@
                        BeanUtils.toBean(list, QueueRespVO.class));
    }
}
    @GetMapping("/opening-setting")
    @Operation(summary = "开诊设置")
    @PreAuthorize("@ss.hasPermission('ecg:queue:setting')")
    public CommonResult<Integer> openingSetting() {
        // 从DB同步工位的患者队列数据到 工位优先队列, 可能有新开工位
        queueService.initBedQueueAndSeqNumFromDB();
        return success(0);
    }
    @GetMapping("/startbiz")
    @Operation(summary = "手动开诊")
    @PreAuthorize("@ss.hasPermission('ecg:queue:setting')")
    public CommonResult<Integer> startBiz() {
        queueService.startBiz();
        return success(0);
    }
    @GetMapping("/patient-jump")
    @Operation(summary = "插队")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "B2")
    @PreAuthorize("@ss.hasPermission('ecg:queue:jump')")
    public CommonResult<String> queueJump(
            @RequestParam("patId") String patId,
            @RequestParam("jumpFlag") Byte jumpFlag)
    {
        Integer result = queueService.patientJump(patId, jumpFlag);
        if (null == result || 0 == result)
            return error( new ErrorCode(201, "找不到患者") );
        return success("success");
    }
}