eight
2025-03-31 fe679e3b438325c689eafa6e6fe0ee455ec59b8e
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -133,11 +133,16 @@
                continue;
            // 从DB查询预约,是否已经存在
            AppointmentDO appointmentDO = appointmentMapper.getByPatAndCheckTypeAndBookDate(appointmentExtermal.getPatId(), appointmentExtermal.getBookCheckType(), appointmentExtermal.getBookDate());
            AppointmentDO appointmentDO = appointmentMapper.getByEpisodeIdAndApplyNo(appointmentExtermal.getEpisodeId(), appointmentExtermal.getApplyNo());
            if (null == appointmentDO) {
                appointmentMapper.insert(appointmentExtermal);
            } else {
                appointmentExtermal.setId( appointmentDO.getId() ); // 确保 返回值包含 appointment id
                // 处理第一次确认时还没有预约时间,再来确认时已有预约时间的情况
                if (appointmentDO.getBookDate() != appointmentExtermal.getBookDate()) {
                    appointmentMapper.updateById( appointmentExtermal );
                }
            }
        }