From d0c6f57f6ba532194df0787a689da46dd09d17e8 Mon Sep 17 00:00:00 2001 From: sindir Date: Thu, 22 Jan 2026 16:37:20 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=8E=A5=E8=AF=8A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/impl/DoctorStationMainAppServiceImpl.java | 5 +++++ .../openhis/administration/domain/EncounterParticipant.java | 6 ++++++ 2 files changed, 11 insertions(+) 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 b8b9907b..7485cd07 100644 --- 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 @@ -123,6 +123,8 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer */ @Override public R receiveEncounter(Long encounterId) { + Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); + String currentUsername = SecurityUtils.getUsername(); int update = encounterMapper.update(null, new LambdaUpdateWrapper().eq(Encounter::getId, encounterId) .set(Encounter::getReceptionTime, new Date()) @@ -140,6 +142,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer encounterParticipant.setTypeCode(ParticipantType.ADMITTER.getCode());// 接诊医生 encounterParticipant.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); encounterParticipant.setStatusEnum(EncounterActivityStatus.ACTIVE.getValue()); // 状态 + encounterParticipant.setTenantId(tenantId); + encounterParticipant.setCreateBy(currentUsername); + encounterParticipant.setCreateTime(new Date()); iEncounterParticipantService.save(encounterParticipant); return update > 0 ? R.ok() : R.fail(); } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/EncounterParticipant.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/EncounterParticipant.java index 39423d35..ef8664ec 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/EncounterParticipant.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/EncounterParticipant.java @@ -1,6 +1,7 @@ package com.openhis.administration.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.core.common.core.domain.HisBaseEntity; @@ -43,4 +44,9 @@ public class EncounterParticipant extends HisBaseEntity { /** 状态 */ private Integer statusEnum; + /** + * 租户ID(新增字段,和数据库的tenant_id对应) + */ + @TableField("tenant_id") // 显式映射数据库字段名,避免MyBatis-Plus自动转换出错 + private Integer tenantId; } \ No newline at end of file From 035738f990f2f6857b61ca97909396f43f3704f7 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Thu, 22 Jan 2026 19:38:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E6=88=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E3=80=8B=E9=87=87=E8=B4=AD=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E3=80=8B=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=EF=BC=9A=E4=BB=93=E5=BA=93=E5=AD=97=E6=AE=B5=E5=80=BC=E4=B8=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E8=80=97=E6=9D=90=E5=BA=93=E5=9C=A8=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E7=AE=A1=E7=90=86=E6=9C=AA=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=E4=BB=93=E5=BA=93=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E5=B8=83=E5=B1=80=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=9C=A8=E6=89=B9=E9=87=8F=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=85=A5=E5=BA=93=E4=B8=9A=E5=8A=A1=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=B3=E8=AF=B7=E4=BA=BA=E7=AD=89=E6=A0=B8=E5=BF=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=95=B0=E6=8D=AE=EF=BC=8C=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E8=8E=B7=E5=8F=96=E5=85=A5=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E6=9F=A5=E8=AF=A2SQL=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PurchaseInventoryAppServiceImpl.java | 13 ++++-- .../PurchaseInventoryMapper.xml | 8 ++-- .../purchaseDocument/index.vue | 42 ++++++++++++++++--- .../purchaseinventory/index.vue | 8 ++-- 4 files changed, 54 insertions(+), 17 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java index 83298f35..bfef3501 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java @@ -25,6 +25,7 @@ import com.openhis.web.inventorymanage.dto.*; import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper; import com.openhis.workflow.domain.SupplyRequest; import com.openhis.workflow.service.ISupplyRequestService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -40,6 +41,7 @@ import java.util.stream.Stream; * @author zwh * @date 2025-03-08 */ +@Slf4j @Service public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppService { @@ -159,6 +161,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer @Override public R> getDetail(String busNo) { List receiptDetailList = purchaseInventoryMapper.selectDetail(busNo); + log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList); if (receiptDetailList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); } @@ -182,7 +185,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer } }); } - + log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList); return R.ok(receiptDetailList); } @@ -194,7 +197,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer */ @Override public R addOrEditInventoryReceipt(List purchaseInventoryDtoList) { - // 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求) boolean validation = supplyRequestService.supplyRequestValidation(purchaseInventoryDtoList.get(0).getBusNo()); if (validation) { @@ -232,11 +234,14 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer // 制单人 .setApplicantId(SecurityUtils.getLoginUser().getPractitionerId()) // 申请时间 - .setApplyTime(DateUtils.getNowDate()); + .setApplyTime(DateUtils.getNowDate()) + + .setCreateBy(SecurityUtils.getLoginUser().getUsername()) + .setCreateTime(DateUtils.getNowDate()) + .setTenantId(SecurityUtils.getLoginUser().getTenantId()); supplyRequestList.add(supplyRequest); } - // 保存 supplyRequestService.saveOrUpdateBatch(supplyRequestList); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml index 248df887..9c922bc2 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml @@ -86,7 +86,7 @@ T3.total_volume, T5."name" AS practitioner_name, T6."name" AS purpose_location_name, - T6."id" AS purpose_location_id, + T1.purpose_location_id AS purpose_location_id, T7."name" AS purpose_location_store_name, T1.occurrence_time, (SELECT SUM(T9.quantity) @@ -119,7 +119,7 @@ ON T1.supplier_id = T10.id AND T10.delete_flag = '0' LEFT JOIN sys_dict_data sdt - ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code' + ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code' WHERE T1.bus_no = #{busNo} AND T1.delete_flag = '0' UNION @@ -145,7 +145,7 @@ T8."size" AS total_volume, T5."name" AS practitioner_name, T6."name" AS purpose_location_name, - T6."id" AS purpose_location_id, + T1.purpose_location_id AS purpose_location_id, T7."name" AS purpose_location_store_name, T1.occurrence_time, (SELECT SUM(T9.quantity) @@ -175,7 +175,7 @@ ON T1.supplier_id = T10.id AND T10.delete_flag = '0' LEFT JOIN sys_dict_data sdt - ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code' + ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code' WHERE T1.bus_no = #{busNo} AND T1.delete_flag = '0' diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue index cc8386b1..681e722b 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue @@ -24,9 +24,9 @@ - 提交审核 + + 提交审核 + @@ -35,7 +35,8 @@ 批量保存批量保存 + @@ -271,11 +272,11 @@ >
+ + +
+ { +// if (newList && newList.length > 0) { +// // 可以触发表格重新渲染或更新相关数据 +// } +// }, { immediate: true }); +const getLocationNameById = (id) => { + // 检查locationList是否已加载 + if (!locationList.value || !Array.isArray(locationList.value) || locationList.value.length === 0) { + return '仓库列表未加载'; + } + + // 使用严格相等比较,处理类型转换 + const location = locationList.value.find(item => { + return item.id == id; // 使用 == 而不是 === 以处理字符串和数字之间的比较 + }); + + return location ? location.name : '仓库不存在'; +}; const viewStatus = ref(""); const startTimeOld = ref(""); const endTimeOld = ref(""); diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue index 54e8e7b2..b7f81c11 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue @@ -205,9 +205,9 @@ > - - - - - = - - - - - - - - - -
- - - - - - - - - - - - - -
- -
+
+
+
+ -
- - - - - - - - - - - - -
- - 确定 - -
+ + +
+ + 确定 + + @@ -1152,6 +926,12 @@ const adviceTypeList = ref([ }, ]); +// 根据类型值获取显示标签,避免非编辑态出现空标签 +const mapAdviceTypeLabel = (type) => { + const found = adviceTypeList.value.find((item) => item.value === type); + return found ? found.label : ''; +}; + // 西药处方管理相关变量 const westernPrescriptions = ref([]); // 西药处方列表 const currentPrescriptionId = ref(null); // 当前活跃的处方ID @@ -2321,6 +2101,8 @@ function handleSaveSign(row, index, prescriptionId) { row.patientId = props.patientInfo.patientId; row.encounterId = props.patientInfo.encounterId; row.accountId = accountId.value; + // 确保非编辑态显示正确的医嘱类型标签 + row.adviceType_dictText = mapAdviceTypeLabel(row.adviceType); if (row.adviceType == 1 || row.adviceType == 2) { row.minUnitQuantity = row.minUnitCode == row.unitCode ? row.quantity : row.quantity * row.partPercent;