jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentRespVO.java
@@ -91,6 +91,10 @@ @ExcelProperty(value = "预约检查类型", converter = DictConvert.class) private Integer bookCheckType; @Schema(description = "内部预约编号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("内部预约编号") private Integer bookSeqNum; @Schema(description = "预约来源:X系统、护士手动预约", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("预约来源:X系统、护士手动预约") private Integer bookSrc; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java
@@ -20,6 +20,9 @@ @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21320") private Integer id; @Schema(description = "内部预约编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21320") private Long appointId; @Schema(description = "患者编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30473") @NotEmpty(message = "患者编号不能为空") private String patId; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
@@ -134,5 +134,7 @@ private LocalDateTime syncTime; @TableField(exist = false) private Integer bookSeqNum; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
@@ -31,6 +31,10 @@ @TableId private Integer id; /** * 内部预约编号 */ private Long appointId; /** * 患者编号 */ private String patId; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
@@ -194,6 +194,13 @@ "</script>" ) QueueDO getFirstItemByRoomAndStatus(@Param("roomId")Long roomId, @Param("curStatusList")List<Integer> curStatusList); @Select("<script> " + "select * from lihu.queue where appoint_id in ( " + " <foreach collection='appointIdList' separator=',' item='appointId'>" + " #{appointId} " + " </foreach> )" + "</script>" ) List<QueueDO> selectBookSeqNumByAppointIdList(@Param("appointIdList") List<Long> appointIdList); /* @Select("select * from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} " + jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -5,6 +5,7 @@ import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO; import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; import cn.lihu.jh.module.ecg.feign.RemoteDataService; import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo; import cn.lihu.jh.module.ecg.feign.RestApiResult; @@ -35,6 +36,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.lihu.jh.framework.common.pojo.CommonResult.error; @@ -124,7 +126,7 @@ */ @Override public List<AppointmentDO> queryAndCreateAppointmentByPatId(String patCode) { // 先从医院平台查询 // 从医院平台查询 List<AppointmentDO> appointmentExtermalList = getAppointmentExtermal( patCode ); for ( int appointmentIndex = 0; appointmentIndex < appointmentExtermalList.size(); appointmentIndex++ ) { @@ -132,12 +134,22 @@ if (null == appointmentExtermal ) continue; // 从DB查到预约,是否已经存在 // 从DB查询预约,是否已经存在 AppointmentDO appointmentDO = appointmentMapper.getByPatAndCheckTypeAndBookDate(appointmentExtermal.getPatId(), appointmentExtermal.getBookCheckType(), appointmentExtermal.getBookDate()); if (null == appointmentDO) { appointmentMapper.insert(appointmentExtermal); } else { appointmentExtermal.setId( appointmentDO.getId() ); // 确保 返回值保护 appointment id appointmentExtermal.setId( appointmentDO.getId() ); // 确保 返回值包含 appointment id } } // 查询[queue表]补充 book_seq_num 到返回值中 if (!appointmentExtermalList.isEmpty()) { List<Long> appointIdlist = appointmentExtermalList.stream().map(appointmentDO -> appointmentDO.getId()).toList(); List<QueueDO> simpleQueueDOList = queueService.selectBookSeqNumByAppointIdList(appointIdlist); if (!simpleQueueDOList.isEmpty()) { Map<Long, Integer> mapAppointIdVsBookSeqNo = simpleQueueDOList.stream().collect(Collectors.toMap(QueueDO::getAppointId, QueueDO::getBookSeqNum)); appointmentExtermalList.forEach(appointmentExterma -> appointmentExterma.setBookSeqNum(mapAppointIdVsBookSeqNo.get(appointmentExterma.getId()))); } } @@ -234,6 +246,7 @@ try { QueueSaveReqVO queueSaveReqVO = new QueueSaveReqVO(); queueSaveReqVO.setAppointId(appointment.getId()); queueSaveReqVO.setPatId(appointment.getPatId()); queueSaveReqVO.setPatName(appointment.getPatName()); queueSaveReqVO.setPatGender(appointment.getPatGender()); jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
@@ -89,6 +89,8 @@ */ void queue(QueueSaveReqVO queueSaveReqVO); List<QueueDO> selectBookSeqNumByAppointIdList(List<Long> appointIdList); /** * 常规检查 医生叫下一位患者 */ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
@@ -339,6 +339,11 @@ startHurryUpOneCheckType( queue.getBookCheckType() ); } @Override public List<QueueDO> selectBookSeqNumByAppointIdList(List<Long> appointIdList) { return queueMapper.selectBookSeqNumByAppointIdList( appointIdList ); } // 常规检查 叫号 @Override public void finishNextPatient(Long roomId, String bedNo) {