From 7c296698aadabafbedc17f413bdcf1b93ae6ab3f Mon Sep 17 00:00:00 2001 From: "Zhang.WH" Date: Mon, 31 Mar 2025 10:20:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E9=80=80=E8=B4=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientChargeAppService.java | 7 ++++ .../IOutpatientRefundAppService.java | 7 ++++ .../impl/OutpatientChargeAppServiceImpl.java | 22 ++++++++++++ .../impl/OutpatientRefundAppServiceImpl.java | 33 +++++++++++++---- .../OutpatientChargeController.java | 10 ++++++ .../OutpatientRefundController.java | 10 ++++++ .../chargemanage/dto/OutpatientInitDto.java | 36 +++++++++++++++++++ .../mapper/OutpatientRefundAppMapper.java | 6 +++- .../OutpatientRefundAppMapper.xml | 8 +++-- 9 files changed, 129 insertions(+), 10 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java index 9e76b7e8..7d493cd7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java @@ -52,4 +52,11 @@ public interface IOutpatientChargeAppService { * @return 操作结果 */ R changeToMedicalInsurance(Long encounterId); + + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + R outpatientChargeInit(); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java index 6d6216ac..a8cd1849 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java @@ -46,4 +46,11 @@ public interface IOutpatientRefundAppService { */ R getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request); + + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + R outpatientRefundInit(); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java index 14afe3eb..a5ccca46 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java @@ -3,8 +3,10 @@ */ package com.openhis.web.chargemanage.appservice.impl; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -28,6 +30,7 @@ import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService; import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; +import com.openhis.web.chargemanage.dto.OutpatientInitDto; import com.openhis.web.chargemanage.mapper.OutpatientChargeAppMapper; /** @@ -46,6 +49,25 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi @Autowired private IAccountService accountService; + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + @Override + public R outpatientChargeInit() { + OutpatientInitDto initDto = new OutpatientInitDto(); + List chargeItemStatusOptions = new ArrayList<>(); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(), + ChargeItemStatus.PLANNED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(), + ChargeItemStatus.BILLABLE.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.BILLED.getInfo())); + initDto.setChargeItemStatusOptions(chargeItemStatusOptions); + return R.ok(initDto); + } + /** * 查询就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java index 21f1f6d7..90df039b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java @@ -27,10 +27,7 @@ import com.openhis.common.utils.HisQueryUtils; import com.openhis.financial.service.IPaymentReconciliationService; import com.openhis.medication.service.IMedicationDispenseService; import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService; -import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; -import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; -import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto; -import com.openhis.web.chargemanage.dto.RefundItemDto; +import com.openhis.web.chargemanage.dto.*; import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper; import com.openhis.workflow.service.IDeviceDispenseService; import com.openhis.workflow.service.IServiceRequestService; @@ -57,6 +54,27 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi @Autowired private IServiceRequestService serviceRequestService; + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + @Override + public R outpatientRefundInit() { + OutpatientInitDto initDto = new OutpatientInitDto(); + List chargeItemStatusOptions = new ArrayList<>(); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.BILLED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(), + ChargeItemStatus.REFUNDING.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(), + ChargeItemStatus.REFUNDED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption( + ChargeItemStatus.PART_REFUND.getValue(), ChargeItemStatus.PART_REFUND.getInfo())); + initDto.setChargeItemStatusOptions(chargeItemStatusOptions); + return R.ok(initDto); + } + /** * 根据就诊id查询患者的账单 * @@ -156,9 +174,10 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), request); // 就诊患者分页列表 - Page encounterPatientPage = - outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, - ChargeItemStatus.BILLED.getValue(), AccountType.MEDICAL_INSURANCE.getValue()); + Page encounterPatientPage = outpatientRefundAppMapper.selectBilledEncounterPatientPage( + new Page<>(pageNo, pageSize), queryWrapper, ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(), + ChargeItemStatus.PART_REFUND.getValue(), AccountType.MEDICAL_INSURANCE.getValue()); encounterPatientPage.getRecords().forEach(e -> { // 性别枚举 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java index 2743406a..11efbed4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java @@ -30,6 +30,16 @@ public class OutpatientChargeController { @Autowired private IOutpatientChargeAppService outpatientChargeAppService; + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R outpatientChargeInit() { + return outpatientChargeAppService.outpatientChargeInit(); + } + /** * 查询就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java index 4e195c6f..7dffbffd 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java @@ -32,6 +32,16 @@ public class OutpatientRefundController { @Autowired private IOutpatientRefundAppService outpatientRefundAppService; + /** + * 门诊退费页面初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R outpatientRefundInit() { + return outpatientRefundAppService.outpatientRefundInit(); + } + /** * 查询结算过的就诊患者分页列表 * diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java new file mode 100644 index 00000000..49392cc8 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java @@ -0,0 +1,36 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 门诊费用相关初始化 + * + * @author zwh + * @date 2025-03-30 + */ +@Data +@Accessors(chain = true) +public class OutpatientInitDto { + + private List chargeItemStatusOptions; + + /** + * 收费状态 + */ + @Data + public static class chargeItemStatusOption { + private Integer value; + private String label; + + public chargeItemStatusOption(Integer value, String label) { + this.value = value; + this.label = label; + } + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java index 293d17b6..b6090a51 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java @@ -59,10 +59,14 @@ public interface OutpatientRefundAppMapper { * @param page 分页 * @param queryWrapper 查询条件 * @param billed 收费状态:已结算 + * @param refunding 收费状态:退费中 + * @param refunded 收费状态:已退费 + * @param partRefund 收费状态:部分退费 * @param insurance 账户类型:医保 * @return 已结算就诊患者分页列表 */ Page selectBilledEncounterPatientPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("billed") Integer billed, - @Param("insurance") Integer insurance); + @Param("refunding") Integer refunding, @Param("refunded") Integer refunded, + @Param("partRefund") Integer partRefund, @Param("insurance") Integer insurance); } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml index d37d7496..ac8dfd6c 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRefundAppMapper.xml @@ -18,7 +18,8 @@ T2.account_id FROM fin_payment_reconciliation AS T1 LEFT JOIN adm_charge_item AS T2 - ON T2.id IN (T1.charge_item_ids) + -- 因为T2.id是long型,T1.charge_item_ids是例如 "1","2" 的string类型,所以需要先转类型再匹配 + ON T2.id::TEXT = ANY(string_to_array(T1.charge_item_ids, ',')) WHERE T1.encouter_id =#{encounterId} AND T1.status_enum IN (#{success},#{refundAll},#{refundPart}) AND T1.delete_flag = '0' @@ -98,6 +99,7 @@ resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto"> SELECT T8.encounter_id, T8.encounter_bus_no, + T8.status_enum, T8.start_time, T8.patient_name, T8.patient_bus_no, @@ -116,6 +118,7 @@ T1.start_time, T1.delete_flag, T1.tenant_id, + T1.status_enum, T2."name" AS patient_name, T2.bus_no AS patient_bus_no, T2.gender_enum, @@ -142,13 +145,14 @@ ON T6.encouter_id = T1.id LEFT JOIN fin_payment_rec_detail AS T7 ON T7.reconciliation_id = T6.id - WHERE T3.status_enum = #{billed} + WHERE T3.status_enum IN (#{billed},#{refunding},#{refunded},#{partRefund}) AND T1.delete_flag = '0' GROUP BY T1.id, T1.bus_no, T1.start_time, T1.delete_flag, T1.tenant_id, + T1.status_enum, T2."name", T2.bus_no, T2.gender_enum,