From b48ca4fb4a4656c3f4a3b0f1f4fc492f09292625 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Sat, 9 May 2026 13:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=20Fix:=20=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A430=20?= =?UTF-8?q?=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F=E7=AB=99-=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E7=94=B3=E8=AF=B7=EF=BC=9A=E5=AE=9E=E7=8E=B0=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E9=87=91=E9=A2=9D=E5=8F=98=E6=9B=B4=E4=B8=8E=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=83=A8=E4=BD=8D=E7=9A=84=E9=87=91=E9=A2=9D/?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=94=B3=E8=AF=B7=E5=8D=95=E5=BC=80=E7=AB=8B?= =?UTF-8?q?=E7=9A=84=E9=A1=B9=E7=9B=AE=E9=87=91=E9=A2=9D=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=81=94=E5=8A=A8=20=20=20bug400:=20?= =?UTF-8?q?=E5=AE=8C=E8=AF=8A=E6=97=B6triage=5Fqueue=5Fitem.status?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A2=9E=E5=8A=A0=E5=9B=9E=E9=80=80=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CheckPackageAppServiceImpl.java | 28 +++++++++++++++++++ .../impl/DoctorStationMainAppServiceImpl.java | 19 +++++++++++++ 2 files changed, 47 insertions(+) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckPackageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckPackageAppServiceImpl.java index d81edbce..a13da5aa 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckPackageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckPackageAppServiceImpl.java @@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.core.common.core.domain.R; import com.openhis.check.domain.CheckPackage; import com.openhis.check.domain.CheckPackageDetail; +import com.openhis.check.domain.CheckPart; import com.openhis.check.service.ICheckPackageDetailService; import com.openhis.check.service.ICheckPackageService; +import com.openhis.check.service.ICheckPartService; import com.openhis.web.check.appservice.ICheckPackageAppService; import com.openhis.web.check.dto.CheckPackageDetailDto; import com.openhis.web.check.dto.CheckPackageDto; @@ -34,6 +36,7 @@ public class CheckPackageAppServiceImpl implements ICheckPackageAppService { private final ICheckPackageService checkPackageService; private final ICheckPackageDetailService checkPackageDetailService; + private final ICheckPartService checkPartService; /** * 转换明细 DTO 列表为实体列表 @@ -61,6 +64,25 @@ public class CheckPackageAppServiceImpl implements ICheckPackageAppService { return details; } + /** + * 同步更新引用此套餐的检查部位价格 + */ + private void syncCheckPartPrice(String packageName, java.math.BigDecimal newPrice) { + if (packageName == null || newPrice == null) { + return; + } + List parts = checkPartService.list( + new LambdaQueryWrapper() + .eq(CheckPart::getPackageName, packageName) + ); + if (parts.isEmpty()) { + return; + } + parts.forEach(part -> part.setPrice(newPrice.doubleValue())); + checkPartService.updateBatchById(parts); + log.info("套餐[{}]价格更新为 {},已同步更新 {} 个检查部位的价格", packageName, newPrice, parts.size()); + } + @Override public R getCheckPackageList() { try { @@ -134,6 +156,9 @@ public class CheckPackageAppServiceImpl implements ICheckPackageAppService { } } + // 同步更新引用此套餐的检查部位价格 + syncCheckPartPrice(checkPackage.getPackageName(), checkPackage.getPackagePrice()); + return R.ok(checkPackage.getId(), "保存成功"); } catch (Exception e) { log.error("新增检查套餐失败", e); @@ -193,6 +218,9 @@ public class CheckPackageAppServiceImpl implements ICheckPackageAppService { checkPackageDetailService.saveBatch(details); } + // 同步更新引用此套餐的检查部位价格 + syncCheckPartPrice(existPackage.getPackageName(), checkPackage.getPackagePrice()); + return R.ok("更新成功"); } catch (Exception e) { log.error("更新检查套餐失败", e); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java index a77b4ff6..844daa74 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java @@ -303,6 +303,22 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer .eq(TriageQueueItem::getDeleteFlag, "0") ); + // 当天未找到时回退:不限日期查最近一条(防止跨日就诊队列项遗漏更新) + if (queueItem == null) { + queueItem = triageQueueItemService.getOne( + new LambdaQueryWrapper() + .eq(TriageQueueItem::getTenantId, tenantId) + .eq(TriageQueueItem::getEncounterId, encounterId) + .eq(TriageQueueItem::getDeleteFlag, "0") + .orderByDesc(TriageQueueItem::getQueueDate) + .last("LIMIT 1") + ); + if (queueItem != null) { + log.warn("完诊:当天队列项未找到,回退使用最近队列记录 queueDate={}, id={}", + queueItem.getQueueDate(), queueItem.getId()); + } + } + // 如果队列项存在且未完成,更新队列状态为已完成 // 使用排除法而非白名单:只要不是"已完成"就可以完诊,覆盖跳过、等待等非标准流转状态 if (queueItem != null && @@ -311,6 +327,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer queueItem.setStatus(TriageQueueStatus.COMPLETED.getValue()); queueItem.setUpdateTime(nowLocal); triageQueueItemService.updateById(queueItem); + } else if (queueItem == null) { + log.error("完诊:未找到任何 triage_queue_item 记录,encounterId={}, tenantId={}", + encounterId, tenantId); } // 写入 div_log 审计日志(独立于队列项,确保每次完诊都生成记录)