eight
2024-10-12 1a7b7c276a56d96573aa814fe19532469e366908
领用&装机 信息统计
已修改5个文件
101 ■■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/PatientStatisticVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
@@ -322,6 +322,33 @@
        return success(patientStatisticVO);
    }
    @GetMapping("/get-dev-ready-statistic")
    @Operation(summary = "设备领用统计")
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
    @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<PatientStatisticVO> getDevReadyStatistic(
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo)
    {
        PatientStatisticVO patientStatisticVO = queueService.getBedDevReadyStatistic(roomId, bedNo);
        return success(patientStatisticVO);
    }
    @GetMapping("/get-dev-install-statistic")
    @Operation(summary = "设备装机统计")
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
    @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<PatientStatisticVO> getDevInstallStatistic(
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo)
    {
        PatientStatisticVO patientStatisticVO = queueService.getBedDevInstallStatistic(roomId, bedNo);
        return success(patientStatisticVO);
    }
    @GetMapping("/recall-patient")
    @Operation(summary = "过号病人召回")
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/PatientStatisticVO.java
@@ -11,6 +11,8 @@
    private Integer readyNum;
    private Integer receivedNum;
    private Integer passedNum;
    private Integer queuingNum;
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
@@ -82,6 +82,21 @@
    Integer statusStatistic(@Param("statusList")List<Byte> statusList);
    @Select("<script>" +
            "SELECT count(1) as total_in_status FROM lihu.queue where " +
            " room_id = #{roomId} and bed_no = #{bedNo} " +
            " and status in ( " +
            " <foreach collection='statusList' separator=',' item='status'>" +
            "  #{status} " +
            " </foreach> ) " +
            " and book_check_type in ( " +
            " <foreach collection='checkTypes' separator=',' item='checkType'>" +
            "  #{checkType} " +
            " </foreach> ) " +
            "</script>")
    Integer checkTypeAndStatusStatistic( @Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("checkTypes")Integer[] checkTypes, @Param("statusList")List<Byte> statusList);
    @Select("<script>" +
            "SELECT room_id, bed_no, count(1) as total_in_status FROM lihu.queue where status in (" +
            " <foreach collection='statusList' separator=',' item='status'>" +
            " #{status} " +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
@@ -115,6 +115,10 @@
    PatientStatisticVO getPatientStatistic(Long roomId, String bedNo);
    PatientStatisticVO getBedDevReadyStatistic(Long roomId, String bedNo);
    PatientStatisticVO getBedDevInstallStatistic(Long roomId, String bedNo);
    Integer recallPatient(Long roomId, String bedNo, String patId);
    Integer patientJump(String patId, Byte jumped );
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
@@ -4,6 +4,7 @@
import java.util.concurrent.*;
import javax.annotation.Resource;
import cn.lihu.jh.module.ecg.Utils;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO;
import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper;
@@ -61,6 +62,8 @@
    private DevRentMapper devRentMapper;
    ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
    ConcurrentHashMap<String, RoomDO> mapRoomBed = new ConcurrentHashMap<>();
    @Override
    public Integer createqueue(QueueSaveReqVO createReqVO) {
@@ -409,6 +412,48 @@
        return patientStatisticVO;
    }
    public PatientStatisticVO getBedDevInstallStatistic(Long roomId, String bedNo) {
        PatientStatisticVO patientStatisticVO = new PatientStatisticVO();
        List<BedQueueStatisticDO> bedQueueStatisticDOList = queueMapper.bedQueueStatistic(roomId, bedNo);
        bedQueueStatisticDOList.forEach(item -> {
            if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) {
                patientStatisticVO.setReceivedNum(item.getTotalInStatus());
            } else if (QueueStatusEnum.FINISH.getStatus() == item.getStatus()) {
                patientStatisticVO.setFinishedNum(item.getTotalInStatus());
            }
        });
        return patientStatisticVO;
    }
    public PatientStatisticVO getBedDevReadyStatistic(Long roomId, String bedNo) {
        PatientStatisticVO patientStatisticVO = new PatientStatisticVO();
        patientStatisticVO.setFinishedNum(0);
        List<BedQueueStatisticDO> bedQueueStatisticDOList = queueMapper.bedQueueStatistic(roomId, bedNo);
        bedQueueStatisticDOList.forEach(item -> {
            if (QueueStatusEnum.READY.getStatus() == item.getStatus()) {
                patientStatisticVO.setReadyNum(item.getTotalInStatus());
            } else if (QueueStatusEnum.PASSED.getStatus() == item.getStatus()) {
                patientStatisticVO.setPassedNum(item.getTotalInStatus());
            } else if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) {
                patientStatisticVO.setFinishedNum( item.getTotalInStatus() + patientStatisticVO.getFinishedNum() );
            } else if (QueueStatusEnum.INSTALLING.getStatus() == item.getStatus()) {
                patientStatisticVO.setFinishedNum( item.getTotalInStatus() + patientStatisticVO.getFinishedNum() );
            } else if (QueueStatusEnum.FINISH.getStatus() == item.getStatus()) {
                patientStatisticVO.setFinishedNum(item.getTotalInStatus() + patientStatisticVO.getFinishedNum());
            }
        });
        RoomDO roomDO = getRoomDO(roomId, bedNo);
        Integer[] checkTypes = roomDO.getCheckTypes();
        List<Byte> statusList = new ArrayList<>();
        statusList.add(QueueStatusEnum.WAITING.getStatus());
        Integer num = queueMapper.checkTypeAndStatusStatistic(roomId, bedNo, checkTypes, statusList);
        patientStatisticVO.setQueuingNum(num);
        return patientStatisticVO;
    }
    public void initCheckType() {
        queueServiceTxFunctions.initCheckType( );
    }
@@ -448,4 +493,12 @@
        return roomMapper.getRoomByDocId(docId);
    }
    private RoomDO getRoomDO(Long roomId, String bedNo) {
        RoomDO roomDO = mapRoomBed.get( Utils.formatRoomBed(roomId, bedNo) );
        if ( null == roomDO)
            roomDO = roomMapper.getRoom(roomId, bedNo);
        return roomDO;
    }
}