eight
2024-08-23 3e696d457f13338a7eb5ad0935a7d2c7affcf605
update
已修改16个文件
130 ■■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentConfirmReqVO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentRespVO.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentSaveReqVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/queueController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queuePageReqVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queueRespVO.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queueSaveReqVO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/queueDO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | 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 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/mysql/jh.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
@@ -193,6 +193,7 @@
        queueSaveReqVO.setPatId( appointment.getPatId());
        queueSaveReqVO.setPatName( appointment.getPatName() );
        queueSaveReqVO.setPatGender( appointment.getPatGender());
        queueSaveReqVO.setBookDate( appointment.getBookDate() );
        queueSaveReqVO.setBookTimeslot( appointment.getBookTimeslot() );
        queueSaveReqVO.setBookCheckType( appointment.getBookCheckType() );
        queueSaveReqVO.setPassed((byte)0);
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentConfirmReqVO.java
@@ -5,6 +5,7 @@
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 预约确认 Request VO")
@@ -31,7 +32,7 @@
    @Schema(description = "预约日期", requiredMode = Schema.RequiredMode.REQUIRED)
    //@NotNull(message = "预约日期不能为空")
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    @Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
    //@NotNull(message = "预约时间段不能为空")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java
@@ -1,6 +1,8 @@
package cn.lihu.jh.module.ecg.controller.admin.appointment.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.lihu.jh.framework.common.pojo.PageParam;
@@ -58,7 +60,7 @@
    private String bookId;
    @Schema(description = "预约日期")
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    @Schema(description = "预约时间段")
    private Integer bookTimeslot;
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentRespVO.java
@@ -2,6 +2,8 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -75,7 +77,7 @@
    @Schema(description = "预约日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("预约日期")
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    @Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("预约时间段")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentSaveReqVO.java
@@ -5,6 +5,7 @@
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 预约新增/修改 Request VO")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
@@ -1,15 +1,10 @@
package cn.lihu.jh.module.ecg.controller.admin.doctor;
import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.framework.common.pojo.PageParam;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.PatientStatisticVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueuePageReqVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueRespVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
@@ -21,13 +16,10 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 医生叫号")
@@ -107,30 +99,21 @@
        return success(patientStatisticVO);
    }
    @GetMapping("/passed-patient-return")
    @Operation(summary = "过期病人回来")
    @GetMapping("/recall-patient")
    @Operation(summary = "过期病人召回")
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
    @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "B2")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:patient')")
    public CommonResult<String> passedPatientReturn(
    public CommonResult<String> recallPatient(
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo,
            @RequestParam("patId") String patId )
    {
        Integer result = queueService.passedPatientReturn(roomId, bedNo, patId);
        return success("success");
    }
        Integer result = queueService.recallPatient(roomId, bedNo, patId);
        if (null == result || 0 == result)
            return error( new ErrorCode(201, "找不到患者") );
    @GetMapping("/queuejump")
    @Operation(summary = "插队")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "B2")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:patient')")
    public CommonResult<String> queueJump(
            @RequestParam("patId") String patId,
            @RequestParam("jumpFlag") Byte jumpFlag)
    {
        Integer result = queueService.queueJump(patId, jumpFlag);
        return success("success");
    }
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;
@@ -109,4 +112,19 @@
        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");
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queuePageReqVO.java
@@ -4,6 +4,8 @@
import io.swagger.v3.oas.annotations.media.Schema;
import cn.lihu.jh.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -23,6 +25,9 @@
    @Schema(description = "患者性别")
    private Boolean patGender;
    @Schema(description = "预约日期")
    private LocalDate bookDate;
    @Schema(description = "预约时间段")
    private Integer bookTimeslot;
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queueRespVO.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@@ -27,6 +28,10 @@
    @ExcelProperty("患者性别")
    private Byte patGender;
    @Schema(description = "预约日期")
    @ExcelProperty("预约日期")
    private LocalDate bookDate;
    @Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("预约时间段")
    private Integer bookTimeslot;
@@ -45,11 +50,15 @@
    @Schema(description = "过号标记", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("过号标记")
    private Boolean passed;
    private Byte passed;
    @Schema(description = "预约过期标记", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("预约过期标记")
    private Boolean expired;
    private Byte expired;
    @Schema(description = "插队标记", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("插队标记")
    private Byte jumpFlag;
    @Schema(description = "诊室编号")
    @ExcelProperty("诊室编号")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/queueSaveReqVO.java
@@ -5,6 +5,7 @@
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -28,7 +29,7 @@
    @Schema(description = "预约日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "预约日期不能为空")
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    @Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "预约时间段不能为空")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
@@ -1,8 +1,9 @@
package cn.lihu.jh.module.ecg.dal.dataobject.appointment;
import lombok.*;
import java.time.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
@@ -92,7 +93,7 @@
    /**
     * 预约日期
     */
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    /**
     * 预约时间段
     */
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/queueDO.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.*;
import cn.lihu.jh.framework.mybatis.core.dataobject.BaseDO;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
@@ -41,7 +42,7 @@
    /**
     * 预约日期
     */
    private LocalDateTime bookDate;
    private LocalDate bookDate;
    /**
     * 预约时间段
     */
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
@@ -108,12 +108,12 @@
                           @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus);
    @Update("update lihu.queue set status = #{newStatus} " +
            " where pat_id = #{patId} amd status = #{curStatus} and room_id = #{roomId} and bed_no = #{bedNo}")
            " where pat_id = #{patId} and status = #{curStatus} and room_id = #{roomId} and bed_no = #{bedNo}")
    Integer passedPatientReturn(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("patId")String patId,
                                @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus);
    @Update("update lihu.queue set jumped = #{jumped} " +
            " where pat_id = #{patId} amd status = #{curStatus}")
    @Update("update lihu.queue set jump_flag = #{jumped} " +
            " where pat_id = #{patId} and status = #{curStatus}")
    Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped );
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
@@ -89,7 +89,7 @@
    PatientStatisticVO getPatientStatistic(Long roomId, String bedNo);
    Integer passedPatientReturn(Long roomId, String bedNo, String patId);
    Integer recallPatient(Long roomId, String bedNo, String patId);
    Integer queueJump( String patId, Byte jumped );
    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
@@ -227,9 +227,7 @@
        if (0 == openingFlag.get())
            return;
        singleThreadExecutor.execute( () -> {
            hurryup();
        });
        startHurryUp();
    }
    private void nextPatient(Long roomId, String bedNo) {
@@ -248,9 +246,7 @@
        priorityQueue.remove(bo);
        priorityQueue.offer(bo);
        singleThreadExecutor.execute( () -> {
            hurryup();
        });
        startHurryUp();
    }
    public void finishNextPatient(Long roomId, String bedNo) {
@@ -301,16 +297,25 @@
    }
    @Override
    public Integer passedPatientReturn(Long roomId, String bedNo, String patId) {
    public Integer recallPatient(Long roomId, String bedNo, String patId) {
        Integer updateNum = queueMapper.passedPatientReturn(roomId, bedNo, patId,
                QueueStatusEnum.PASSED.getStatus(), QueueStatusEnum.PASSED_RETURN.getStatus());
        startHurryUp();
        return updateNum;
    }
    @Override
    public Integer queueJump(String patId, Byte jumped) {
    public Integer patientJump(String patId, Byte jumped) {
        Integer updateNum = queueMapper.queueJump(patId, QueueStatusEnum.WAITING.getStatus(), jumped);
        return null;
        startHurryUp();
        return updateNum;
    }
    private void startHurryUp() {
        singleThreadExecutor.execute( () -> {
            hurryup();
        });
    }
}
sql/mysql/jh.sql
@@ -22,7 +22,7 @@
  `pat_ward_desc` varchar(45) DEFAULT '' COMMENT '患者所在病区名称',
  `pat_bed_no` varchar(45) DEFAULT '' COMMENT '床号',
  `book_id` varchar(45) DEFAULT '' COMMENT '预约编号',
  `book_date` datetime NOT NULL COMMENT '预约日期',
  `book_date` date NOT NULL COMMENT '预约日期',
  `book_timeslot` int NOT NULL COMMENT '预约时间段',
  `book_time` datetime NOT NULL COMMENT '预约发生时间',
  `book_check_type` tinyint(1) DEFAULT NULL COMMENT '预约检查类型',
@@ -47,7 +47,7 @@
  `pat_id` varchar(30) NOT NULL COMMENT '患者编号',
  `pat_name` varchar(10) NOT NULL COMMENT '患者姓名',
  `pat_gender` tinyint DEFAULT NULL COMMENT '患者性别',
  `book_date` dateTime NOT NULL COMMENT '预约日期',
  `book_date` date NOT NULL COMMENT '预约日期',
  `book_timeslot` int NOT NULL COMMENT '预约时间段',
  `book_check_type` tinyint DEFAULT NULL COMMENT '预约检查类型',
  `seq_num` int DEFAULT NULL COMMENT '排队序号',