From fe07cee58c62cce6e2a0cbae4e1c7f0633584198 Mon Sep 17 00:00:00 2001 From: chenqi Date: Tue, 10 Mar 2026 18:16:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=88=E5=B9=B6=20upstream/v1.3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=EF=BC=88?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=90=88=E5=B9=B6=E7=AD=96=E7=95=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增功能模块: - 药房管理:住院退药、处方审核功能 - 报表管理:门诊管理报表、药房结算报表、医嘱统计报表 - 支付管理:三方对账功能 - 新增枚举类:电子处方类型、频次类型、病历状态等10个 - 新增实体类:处方审核记录、第三方支付请求、中医结算目录 - 工具类增强:年龄计算、Excel工具 合并策略:仅合并低风险新增文件,保留现有业务功能 上游版本:v1.3 (2025-03-06发版) 合并分支:merge-upstream-v1.3-0310 🤖 Auto-generated by Claude Code --- .../core/common/annotation/ExcelExtra.java | 14 +- .../java/com/core/common/enums/RoleEnum.java | 28 + .../core/common/utils/AgeCalculatorUtil.java | 160 ++-- .../com/core/common/utils/NewExcelUtil.java | 139 ++-- .../dto/ThreePartCompareDto.java | 18 + .../dto/ThreePartComparePaymentDto.java | 29 + .../dto/ThreePartCompareRequestDto.java | 17 + .../mapper/ThreePartPayMapper.java | 28 + .../IInHospitalReturnMedicineAppService.java | 59 ++ .../IPrescriptionReviewAppService.java | 62 ++ ...nHospitalReturnMedicineAppServiceImpl.java | 686 ++++++++++++++++++ .../PrescriptionReviewAppServiceImpl.java | 266 +++++++ .../InHospitalReturnMedicineController.java | 89 +++ .../PrescriptionReviewController.java | 80 ++ .../pharmacymanage/dto/JlauDispenseParam.java | 33 + .../InHospitalReturnMedicineAppMapper.java | 66 ++ .../IAmbAdviceStatisticsAppService.java | 71 ++ .../IOutpatientManageReportAppService.java | 37 + .../IPharmacySettlementReportAppService.java | 43 ++ .../AmbAdviceStatisticsAppServiceImpl.java | 119 +++ .../OutpatientManageReportAppServiceImpl.java | 127 ++++ ...harmacySettlementReportAppServiceImpl.java | 473 ++++++++++++ .../AmbAdviceStatisticsAppController.java | 112 +++ .../OutpatientManageReportController.java | 93 +++ ...PharmacySettlementReportAppController.java | 67 ++ .../dto/AmbActAdviceStatisticsDto.java | 99 +++ .../dto/AmbMedAdviceStatisticsDto.java | 111 +++ .../web/reportmanage/dto/AmountNumberDto.java | 4 +- .../dto/AnnualReportStatisticsPageDto.java | 4 +- .../web/reportmanage/dto/BottleLabelDto.java | 11 +- .../web/reportmanage/dto/ChargeReportDto.java | 5 +- .../reportmanage/dto/ChargeReportInitDto.java | 2 + .../reportmanage/dto/ChargeReportPageDto.java | 12 +- .../dto/ChargeReportSearchParam.java | 1 + .../dto/DailyReportStatisticsPageDto.java | 4 +- .../DepartmentRevenueStatisticsPageDto.java | 9 +- .../dto/DrugDosageSettlementPageDto.java | 13 +- .../dto/DrugDosageSettlementSearchParam.java | 2 + .../dto/InboundReportInitDto.java | 5 +- .../dto/InboundReportPageDto.java | 9 +- .../dto/InboundReportSearchParam.java | 4 +- ...entMedicalRecordHomePageCollectionDto.java | 11 +- ...InpatientMedicalRecordHomePageMakeDto.java | 6 +- .../dto/InventoryProductReportPageDto.java | 7 +- .../InventoryProductReportSearchParam.java | 10 +- .../reportmanage/dto/LossReportPageDto.java | 7 +- .../dto/LossReportSearchParam.java | 4 +- .../reportmanage/dto/MedDevUseReportDto.java | 6 +- .../reportmanage/dto/MedUseReportInfoDto.java | 8 +- .../dto/MedicationUsageParam.java | 31 + .../dto/MonthlySettlementDto.java | 5 +- .../dto/MonthlySettlementInitDto.java | 5 +- .../dto/OutboundReportInitDto.java | 5 +- .../dto/OutboundReportPageDto.java | 2 + .../dto/OutboundReportSearchParam.java | 3 + .../dto/OutpatientBillingDto.java | 166 +++++ .../dto/OutpatientManageParam.java | 33 + .../dto/OutpatientSettlementDto.java | 1 + .../dto/PharmacySettlementMedDto.java | 90 +++ .../dto/PharmacySettlementReportDto.java | 243 +++++++ .../dto/PrescriptionPrintDto.java | 12 +- .../dto/PurchaseReturnReportInitDto.java | 5 +- .../dto/PurchaseReturnReportPageDto.java | 7 +- .../dto/PurchaseReturnReportSearchParam.java | 4 +- .../dto/RegisterReportInitDto.java | 4 +- .../dto/RegisterReportPageDto.java | 5 + .../dto/RegisterReportSearchParam.java | 2 + .../dto/ReportBasicInformationDetailsDto.java | 37 +- .../dto/ReportDetailsSearchParam.java | 4 +- .../dto/ReportDiseaseDetailsDto.java | 9 + .../dto/ReportDrugCostGrowthDto.java | 4 +- .../ReportMedicationInboundDetailsDto.java | 5 +- .../dto/ReportMedicationSaleDetailsDto.java | 9 + .../ReportMedicationStockOutDetailsDto.java | 4 +- .../dto/ReportMedicationUsageDto.java | 96 ++- .../dto/ReportNonWinQtyRatioDto.java | 4 +- .../dto/ReportOfflinePurchaseRatioDto.java | 7 +- .../dto/ReportPatientDetailsDto.java | 71 +- .../dto/ReportPatientDetailsSearchParam.java | 14 +- .../dto/ReportPatientMasterDetailDto.java | 23 +- ...ReportPatientMasterDetailsSearchParam.java | 13 + .../dto/ReportPhysicianWorkloadPageDto.java | 5 +- .../dto/ReportProductUsageDto.java | 5 +- .../dto/ReportStockOutDetailDto.java | 8 +- .../dto/ReportThirtyDayCollectionRateDto.java | 4 +- .../dto/ReturnIssueReportInitDto.java | 5 +- .../dto/ReturnIssueReportPageDto.java | 7 +- .../dto/ReturnIssueReportSearchParam.java | 4 +- .../dto/StocktakingReportPageDto.java | 7 +- .../dto/StocktakingReportSearchParam.java | 4 +- .../dto/TransferReportPageDto.java | 7 +- .../dto/TransferReportSearchParam.java | 4 +- .../dto/UnitTransformationDto.java | 46 ++ .../reportmanage/dto/WorkloadQueryParam.java | 69 ++ .../web/reportmanage/dto/ZyCostDetailDto.java | 35 + .../reportmanage/dto/ZyCostDetailParam.java | 62 ++ .../reportmanage/dto/workloadReportDto.java | 9 +- .../mapper/AmbAdviceStatisticsAppMapper.java | 57 ++ .../PharmacySettlementReportAppMapper.java | 80 ++ .../paymentmanage/ThreePartPayMapper.xml | 43 ++ .../InHospitalReturnMedicineAppMapper.xml | 165 +++++ .../AmbAdviceStatisticsAppMapper.xml | 100 +++ .../PharmacySettlementReportAppMapper.xml | 123 ++++ .../common/enums/ElePrescriptionType.java | 59 ++ .../openhis/common/enums/FrequencyType.java | 31 + .../common/enums/MedicalRecordStatus.java | 26 + .../common/enums/PrescriptionCategory.java | 41 ++ .../common/enums/ReviewReasonEnum.java | 57 ++ .../common/enums/ReviewReasonableStatus.java | 27 + .../openhis/common/enums/SettleUpStatus.java | 35 + .../openhis/common/enums/SurgicalStatus.java | 49 ++ .../common/enums/ThreePartPayType.java | 45 ++ .../domain/PrescriptionReviewRecord.java | 64 ++ .../dto/OutpatientManageDto.java | 112 +++ .../financial/domain/ThreePartPayRequest.java | 72 ++ .../ybcatalog/domain/CatalogZySettleUp.java | 76 ++ 116 files changed, 5406 insertions(+), 330 deletions(-) create mode 100644 openhis-server-new/core-common/src/main/java/com/core/common/enums/RoleEnum.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartComparePaymentDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareRequestDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/ThreePartPayMapper.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInHospitalReturnMedicineAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IPrescriptionReviewAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PrescriptionReviewAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InHospitalReturnMedicineController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/PrescriptionReviewController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/JlauDispenseParam.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InHospitalReturnMedicineAppMapper.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IAmbAdviceStatisticsAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IOutpatientManageReportAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IPharmacySettlementReportAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/AmbAdviceStatisticsAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/OutpatientManageReportAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/PharmacySettlementReportAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/AmbAdviceStatisticsAppController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/OutpatientManageReportController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/PharmacySettlementReportAppController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbActAdviceStatisticsDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbMedAdviceStatisticsDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedicationUsageParam.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientBillingDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientManageParam.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementMedDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementReportDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/UnitTransformationDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/WorkloadQueryParam.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailParam.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/AmbAdviceStatisticsAppMapper.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/PharmacySettlementReportAppMapper.java create mode 100644 openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/ThreePartPayMapper.xml create mode 100644 openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InHospitalReturnMedicineAppMapper.xml create mode 100644 openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/AmbAdviceStatisticsAppMapper.xml create mode 100644 openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/PharmacySettlementReportAppMapper.xml create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ElePrescriptionType.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/FrequencyType.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/MedicalRecordStatus.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/PrescriptionCategory.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonEnum.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonableStatus.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SettleUpStatus.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java create mode 100644 openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ThreePartPayType.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/PrescriptionReviewRecord.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/dto/OutpatientManageDto.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/domain/ThreePartPayRequest.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/domain/CatalogZySettleUp.java diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java index 9431c01f..8d206552 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/ExcelExtra.java @@ -1,6 +1,7 @@ package com.core.common.annotation; import java.lang.annotation.*; +import java.math.BigDecimal; /** * Excel额外表头信息注解 @@ -14,7 +15,7 @@ public @interface ExcelExtra { /** * 表头名称 */ - String name(); + String name() default ""; /** * 日期格式,如:yyyy-MM-dd HH:mm:ss @@ -35,4 +36,15 @@ public @interface ExcelExtra { * 是否导出 */ boolean isExport() default true; + + /** + * 精度 默认:-1(默认不开启BigDecimal格式化) + */ + int scale() default -1; + + /** + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN + */ + int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + } \ No newline at end of file diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/enums/RoleEnum.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/RoleEnum.java new file mode 100644 index 00000000..450ad623 --- /dev/null +++ b/openhis-server-new/core-common/src/main/java/com/core/common/enums/RoleEnum.java @@ -0,0 +1,28 @@ +package com.core.common.enums; + +/** + * 角色枚举 + * + * @author swb + * @date 2026-01-29 + */ +public enum RoleEnum { + DOCTOR("doctor", "医生"), + NURSE("nurse", "护士"), + ADMIN("admin", "管理员"); + private final String code; + private final String info; + + RoleEnum(String code, String info) { + this.code = code; + this.info = info; + } + + public String getCode() { + return code; + } + + public String getInfo() { + return info; + } +} diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java index d070a0ef..59eabd72 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java @@ -33,67 +33,125 @@ public final class AgeCalculatorUtil { return period.getYears(); } +// /** +// * 当前年龄取得(床位列表表示年龄用) +// */ +// public static String getAge(Date date) { +// // 将 Date 转换为 LocalDateTime +// LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); +// LocalDateTime now = LocalDateTime.now(); +// int years = now.getYear() - dateTime.getYear(); +// if (years > 2) { +// return String.format("%d岁", years); +// } +// +// Period period = Period.between(dateTime.toLocalDate(), now.toLocalDate()); +// int months = period.getMonths(); +// int days = period.getDays(); +// long hours = ChronoUnit.HOURS.between(dateTime, now) - (days * 24L); +// +// if (hours < 0) { +// hours += 24; +// days--; +// } +// if (days < 0) { +// months--; +// days = getLastDayOfMonth(dateTime) - dateTime.getDayOfMonth() + now.getDayOfMonth(); +// } +// if (months < 0) { +// months += 12; +// years--; +// } +// if (years < 0) { +// return "1小时"; +// } +// +// if (years > 0 && months > 0) { +// return String.format("%d岁%d月", years, months); +// } +// if (years > 0) { +// return String.format("%d岁", years); +// } +// if (months > 0 && days > 0) { +// return String.format("%d月%d天", months, days); +// } +// if (months > 0) { +// return String.format("%d月", months); +// } +// if (days > 0 && hours > 0) { +// return String.format("%d天%d小时", days, hours); +// } +// if (days > 0) { +// return String.format("%d天", days); +// } +// if (hours > 0) { +// return String.format("%d小时", hours); +// } +// return "1小时"; +// } /** - * 当前年龄取得(床位列表表示年龄用) + * 复刻Oracle函数FUN_GET_AGE的核心逻辑:返回年龄字符串 + * + * @param birthDate 出生日期 + * @return 年龄字符串(如:29岁、3岁5月、2月15天、18天),出生日期晚于当前日期返回空字符串 */ - public static String getAge(Date date) { - // 添加空值检查 - if (date == null) { + public static String getAge(Date birthDate) { + // 入参校验 + if (birthDate == null) { return ""; } - // 将 Date 转换为 LocalDateTime - LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); - LocalDateTime now = LocalDateTime.now(); - int years = now.getYear() - dateTime.getYear(); - if (years > 2) { - return String.format("%d岁", years); + + // 将Date转换为LocalDate(使用系统默认时区) + LocalDate birthLocalDate = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate currentDate = LocalDate.now(); + + // 计算总天数(对应Oracle中的IDAY) + long totalDays = ChronoUnit.DAYS.between(birthLocalDate, currentDate); + + // 若出生日期晚于当前日期,返回空字符串 + if (totalDays < 0) { + return ""; } - Period period = Period.between(dateTime.toLocalDate(), now.toLocalDate()); - int months = period.getMonths(); - int days = period.getDays(); - long hours = ChronoUnit.HOURS.between(dateTime, now) - (days * 24L); + // 计算年份(复刻Oracle的闰年补偿逻辑:(当前年-出生年)/4 补偿闰年天数) + int birthYear = birthLocalDate.getYear(); + int currentYear = currentDate.getYear(); + long leapYearCompensation = (currentYear - birthYear) / 4; + long adjustedDays = totalDays - leapYearCompensation; - if (hours < 0) { - hours += 24; - days--; - } - if (days < 0) { - months--; - days = getLastDayOfMonth(dateTime) - dateTime.getDayOfMonth() + now.getDayOfMonth(); - } - if (months < 0) { - months += 12; - years--; - } - if (years < 0) { - return "1小时"; - } + // 计算年、月、天(按365天/年、30天/月粗略折算,与Oracle逻辑一致) + int iYear = (int) (adjustedDays / 365); + long remainingDaysAfterYear = adjustedDays - iYear * 365; + int iMonth = (int) (remainingDaysAfterYear / 30); + int iDay = (int) (remainingDaysAfterYear - iMonth * 30); - if (years > 0 && months > 0) { - return String.format("%d岁%d月", years, months); + // 按原函数规则拼接返回字符串 + if (iYear <= 0) { + // 小于1岁 + if (iMonth <= 0) { + // 小于1个月,返回X天 + return iDay + "天"; + } else { + // 1个月及以上,返回X月X天 + return iMonth + "月" + iDay + "天"; + } + } else { + // 1岁及以上 + if (iYear < 5) { + // 1-4岁 + if (iMonth <= 0) { + // 无整月,返回X岁X天 + return iYear + "岁" + iDay + "天"; + } else { + // 有整月,返回X岁X月 + return iYear + "岁" + iMonth + "月"; + } + } else { + // 5岁及以上,仅返回X岁 + return iYear + "岁"; + } } - if (years > 0) { - return String.format("%d岁", years); - } - if (months > 0 && days > 0) { - return String.format("%d月%d天", months, days); - } - if (months > 0) { - return String.format("%d月", months); - } - if (days > 0 && hours > 0) { - return String.format("%d天%d小时", days, hours); - } - if (days > 0) { - return String.format("%d天", days); - } - if (hours > 0) { - return String.format("%d小时", hours); - } - return "1小时"; } - private static int getLastDayOfMonth(LocalDateTime dateTime) { int[] daysInMonth = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if (isLeapYear(dateTime.getYear()) && dateTime.getMonthValue() == 2) { diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java index 865355f9..ba57a561 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/NewExcelUtil.java @@ -1,19 +1,18 @@ package com.core.common.utils; -import com.core.common.annotation.Excel; -import com.core.common.annotation.Excel.ColumnType; -import com.core.common.annotation.Excel.Type; -import com.core.common.annotation.ExcelExtra; -import com.core.common.annotation.Excels; -import com.core.common.config.CoreConfig; -import com.core.common.core.domain.AjaxResult; -import com.core.common.core.text.Convert; -import com.core.common.exception.UtilException; -import com.core.common.utils.file.FileTypeUtils; -import com.core.common.utils.file.FileUtils; -import com.core.common.utils.file.ImageUtils; -import com.core.common.utils.poi.ExcelHandlerAdapter; -import com.core.common.utils.reflect.ReflectUtils; +import java.io.*; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +import javax.servlet.http.HttpServletResponse; + import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.reflect.FieldUtils; @@ -30,17 +29,20 @@ import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; +import com.core.common.annotation.Excel; +import com.core.common.annotation.Excel.ColumnType; +import com.core.common.annotation.Excel.Type; +import com.core.common.annotation.ExcelExtra; +import com.core.common.annotation.Excels; +import com.core.common.config.CoreConfig; +import com.core.common.core.domain.AjaxResult; +import com.core.common.core.text.Convert; +import com.core.common.exception.UtilException; +import com.core.common.utils.file.FileTypeUtils; +import com.core.common.utils.file.FileUtils; +import com.core.common.utils.file.ImageUtils; +import com.core.common.utils.poi.ExcelHandlerAdapter; +import com.core.common.utils.reflect.ReflectUtils; /** * Excel相关处理 @@ -1164,6 +1166,11 @@ public class NewExcelUtil { ParameterizedType pt = (ParameterizedType)field.getGenericType(); Class subClass = (Class)pt.getActualTypeArguments()[0]; this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class); + if (StringUtils.isNotEmpty(includeFields)) { + this.subFields = this.subFields.stream().filter(f -> ArrayUtils.contains(includeFields, f.getName())).collect(Collectors.toList()); + } else if (StringUtils.isNotEmpty(excludeFields)) { + this.subFields = this.subFields.stream().filter(f -> !ArrayUtils.contains(excludeFields, f.getName())).collect(Collectors.toList()); + } } } @@ -1441,7 +1448,28 @@ public class NewExcelUtil { } try { + // 计算表格体总列数 + int totalCols = 0; + for (Object[] os : fields) { + Field field = (Field)os[0]; + if (Collection.class.isAssignableFrom(field.getType()) && subFields != null) { + long subCount = subFields.stream().filter(f -> f.isAnnotationPresent(Excel.class)).count(); + totalCols += subCount; + } else { + totalCols++; + } + } + if (totalCols == 0) totalCols = 1; + int currentRowNum = rownum; + int colIndex = 0; + Row row = null; + boolean hasVisible = false; + + // 布局配置:Label占用1列,Value占用2列,共3列 + int labelCols = 1; + int valueCols = 2; + int itemCols = labelCols + valueCols; for (Object[] os : extraFields) { Field field = (Field)os[0]; @@ -1451,43 +1479,50 @@ public class NewExcelUtil { if (isExtraFieldHidden(field.getName())) { continue; } + hasVisible = true; - Row row = sheet.createRow(currentRowNum++); + // 自动换行:如果不是行首,且剩余空间不足,则换行 + if (row == null) { + row = sheet.createRow(currentRowNum); + } else if (colIndex > 0 && colIndex + itemCols > totalCols) { + currentRowNum++; + row = sheet.createRow(currentRowNum); + colIndex = 0; + } - // 创建标签单元格(第0列) - Cell labelCell = row.createCell(0); + // 1. 创建 Label 单元格 + Cell labelCell = row.createCell(colIndex); labelCell.setCellValue(attr.name()); labelCell.setCellStyle(styles.get("extraLabel")); - // 创建值单元格(第1列) - Cell valueCell = row.createCell(1); + // 2. 创建 Value 单元格 + int valueStartCol = colIndex + labelCols; + Cell valueCell = row.createCell(valueStartCol); Object value = field.get(entity); String cellValue = formatExtraCellValue(value, attr); valueCell.setCellValue(StringUtils.isNull(cellValue) ? attr.defaultValue() : cellValue); valueCell.setCellStyle(styles.get("extraValue")); - // 创建合并区域(第1列到第2列) - CellRangeAddress mergedRegion = new CellRangeAddress(row.getRowNum(), row.getRowNum(), 1, 2); - sheet.addMergedRegion(mergedRegion); + // 3. 合并 Value 单元格 + if (valueCols > 1) { + int valueEndCol = valueStartCol + valueCols - 1; + CellRangeAddress mergedRegion = new CellRangeAddress(row.getRowNum(), row.getRowNum(), valueStartCol, valueEndCol); + sheet.addMergedRegion(mergedRegion); + + // 设置边框 + RegionUtil.setBorderTop(BorderStyle.THIN, mergedRegion, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, mergedRegion, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, mergedRegion, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, mergedRegion, sheet); + } - // 手动设置合并区域的边框,确保完整显示 - RegionUtil.setBorderTop(BorderStyle.THIN, mergedRegion, sheet); - RegionUtil.setBorderBottom(BorderStyle.THIN, mergedRegion, sheet); - RegionUtil.setBorderLeft(BorderStyle.THIN, mergedRegion, sheet); - RegionUtil.setBorderRight(BorderStyle.THIN, mergedRegion, sheet); - RegionUtil.setTopBorderColor(IndexedColors.BLACK.getIndex(), mergedRegion, sheet); - RegionUtil.setBottomBorderColor(IndexedColors.BLACK.getIndex(), mergedRegion, sheet); - RegionUtil.setLeftBorderColor(IndexedColors.BLACK.getIndex(), mergedRegion, sheet); - RegionUtil.setRightBorderColor(IndexedColors.BLACK.getIndex(), mergedRegion, sheet); + colIndex += itemCols; } - // 设置列宽 - sheet.setColumnWidth(0, 15 * 256); // 标签列宽 - sheet.setColumnWidth(1, 20 * 256); // 值列宽 - sheet.setColumnWidth(2, 20 * 256); // 值列宽 - // 更新当前行号,在额外表头和数据表头之间空一行 - rownum = currentRowNum + 1; + if (hasVisible) { + rownum = currentRowNum + 2; + } subMergedFirstRowNum = rownum; subMergedLastRowNum = rownum; @@ -1508,6 +1543,10 @@ public class NewExcelUtil { return ""; } + if (value instanceof BigDecimal && attr.scale() >= 0) { + return ((BigDecimal) value).setScale(attr.scale(), attr.roundingMode()).toString(); + } + if (StringUtils.isNotEmpty(attr.dateFormat())) { return parseDateToStr(attr.dateFormat(), value); } @@ -1808,7 +1847,7 @@ public class NewExcelUtil { row = sheet.createRow(rowNo); } // 子字段也要排序 - List subFields = FieldUtils.getFieldsListWithAnnotation(obj.getClass(), Excel.class); + List subFields = this.subFields; List sortedSubFields = subFields.stream().sorted(Comparator.comparing(subField -> { Excel subExcel = subField.getAnnotation(Excel.class); return subExcel.sort(); @@ -1832,4 +1871,4 @@ public class NewExcelUtil { } } } -} \ No newline at end of file +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareDto.java new file mode 100644 index 00000000..bdf85b4d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareDto.java @@ -0,0 +1,18 @@ +package com.openhis.web.paymentmanage.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class ThreePartCompareDto { + /** + * 待比较的付款单 + */ + private List payments; + + /** + * 待比较的付款请求 + */ + private List paymentRequests; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartComparePaymentDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartComparePaymentDto.java new file mode 100644 index 00000000..e352a503 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartComparePaymentDto.java @@ -0,0 +1,29 @@ +package com.openhis.web.paymentmanage.dto; + +import java.math.BigDecimal; +import java.util.Date; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; + +@Data +public class ThreePartComparePaymentDto { + + @JsonSerialize(using = ToStringSerializer.class) + private Long paymentId;// 支付单id + + private String paymentNo;// 支付单号 + + private String patientName;// 患者名称 + + private BigDecimal tenderedAmount;// 应收 + + private BigDecimal paidAmount;// 实收 + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date billDate;// 支付时间 +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareRequestDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareRequestDto.java new file mode 100644 index 00000000..ed6b20cc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/dto/ThreePartCompareRequestDto.java @@ -0,0 +1,17 @@ +package com.openhis.web.paymentmanage.dto; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class ThreePartCompareRequestDto { + + private Long requestId;// 请求ID + + private String paymentId;//paymentId + + private BigDecimal amount;//请求金额 + + private String requestType;//退or付款 +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/ThreePartPayMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/ThreePartPayMapper.java new file mode 100644 index 00000000..36877e60 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/mapper/ThreePartPayMapper.java @@ -0,0 +1,28 @@ +package com.openhis.web.paymentmanage.mapper; + +import com.openhis.web.paymentmanage.dto.ThreePartComparePaymentDto; +import com.openhis.web.paymentmanage.dto.ThreePartCompareRequestDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +@Repository +public interface ThreePartPayMapper { + /** + * 获取支付数据 + * @param startTime + * @param endTime + * @return + */ + List getThreePartComparePaymentDtoList(@Param("startTime") String startTime,@Param("endTime") String endTime); + + /** + * 获取第三方支付请求数据 + * @param paymentIds + * @return + */ + List getThreePartCompareRequestDtoList(@Param("paymentIds")List paymentIds); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInHospitalReturnMedicineAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInHospitalReturnMedicineAppService.java new file mode 100644 index 00000000..676bc4c8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IInHospitalReturnMedicineAppService.java @@ -0,0 +1,59 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.pharmacymanage.appservice; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import com.openhis.web.pharmacymanage.dto.EncounterInfoDto; +import com.openhis.web.pharmacymanage.dto.ReturnMedicineDto; + +/** + * TODO:概括描述当前类的主要用途和注意事项 + * + * @author zwh + * @date 2025-12-29 + */ +public interface IInHospitalReturnMedicineAppService { + + /** + * 页面初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 查询退药患者分页列表 + * + * @param encounterInfoDto 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param request 请求数据 + * @return 退药患者分页列表 + */ + R getReturnMedicinePatientPage(EncounterInfoDto encounterInfoDto, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); + + /** + * 查询退药信息 + * + * @param encounterId 就诊ID + * @param refundStatus 退药id + * @param itemTable 项目类型 + * @return 退药信息 + */ + R getReturnMedicineInfo(Long encounterId, Integer refundStatus, String itemTable); + + /** + * 退药处理 + * + * @param medicineReturnList 退药清单 + * @return 处理结果 + */ + R medicineReturn(List medicineReturnList); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IPrescriptionReviewAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IPrescriptionReviewAppService.java new file mode 100644 index 00000000..ec4a1a6f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/IPrescriptionReviewAppService.java @@ -0,0 +1,62 @@ +package com.openhis.web.pharmacymanage.appservice; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.core.common.core.domain.R; +import com.openhis.administration.dto.PrescriptionReviewRecordDto; + +/** + * 处方审方 应用实现接口 + * + * @author swb + * @date 2026/01/29 + */ +public interface IPrescriptionReviewAppService { + + /** + * 审方 + * + * @param recordDto 处方审方记录dto + * @return 是否成功 + */ + R review(PrescriptionReviewRecordDto recordDto); + + /** + * 查询处方审方记录 + * + * @param prescriptionNoList 处方号集合 + * @param reviewStatus 审核状态 + * @return 处方审方记录 + */ + List getPrescriptionReviewRecords(List prescriptionNoList, + Integer reviewStatus); + + /** + * 查询处方审核信息 + * + * @param practitionerId 参与者id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 处方审核信息 + */ + R getPrescriptionReviewPageInfo(Long practitionerId, Integer reviewStatus, String patientName, Integer pageNo, + Integer pageSize, HttpServletRequest request); + + /** + * 导出处方审核信息 + * + * @param practitionerId 参与者id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param request 请求 + * @param response 响应 + */ + void makeFile(Long practitionerId, Integer reviewStatus, String patientName, HttpServletRequest request, + HttpServletResponse response); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java new file mode 100644 index 00000000..118c305d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/InHospitalReturnMedicineAppServiceImpl.java @@ -0,0 +1,686 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.pharmacymanage.appservice.impl; + +import java.math.BigDecimal; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang3.tuple.Pair; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.exception.ServiceException; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.SecurityUtils; +import com.openhis.administration.domain.*; +import com.openhis.administration.service.*; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.enums.ybenums.YbInvChgType; +import com.openhis.common.enums.ybenums.YbMdtrtCertType; +import com.openhis.common.enums.ybenums.YbRxFlag; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.financial.domain.Contract; +import com.openhis.financial.domain.PaymentReconciliation; +import com.openhis.financial.service.IContractService; +import com.openhis.financial.service.IPaymentReconciliationService; +import com.openhis.medication.domain.MedicationDefinition; +import com.openhis.medication.domain.MedicationDispense; +import com.openhis.medication.domain.MedicationRequest; +import com.openhis.medication.service.IMedicationDefinitionService; +import com.openhis.medication.service.IMedicationDispenseService; +import com.openhis.medication.service.IMedicationRequestService; +import com.openhis.web.inventorymanage.appservice.impl.ReceiptApprovalAppServiceImpl; +import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto; +import com.openhis.web.pharmacymanage.appservice.IInHospitalReturnMedicineAppService; +import com.openhis.web.pharmacymanage.dto.*; +import com.openhis.web.pharmacymanage.mapper.InHospitalReturnMedicineAppMapper; +import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper; +import com.openhis.workflow.domain.DeviceDispense; +import com.openhis.workflow.domain.InventoryItem; +import com.openhis.workflow.service.IDeviceDispenseService; +import com.openhis.workflow.service.IDeviceRequestService; +import com.openhis.workflow.service.IInventoryItemService; +import com.openhis.yb.domain.ClinicSettle; +import com.openhis.yb.dto.Medical3506Param; +import com.openhis.yb.dto.MedicalInventory3511Param; +import com.openhis.yb.service.IClinicSettleService; +import com.openhis.yb.service.YbManager; + +/** + * TODO:概括描述当前类的主要用途和注意事项 + * + * @author zwh + * @date 2025-12-29 + */ +@Service +public class InHospitalReturnMedicineAppServiceImpl implements IInHospitalReturnMedicineAppService { + + @Resource + private ITraceNoManageService traceNoManageService; + + @Resource + private IOrganizationService iOrganizationService; + + @Resource + private IInventoryItemService iInventoryItemService; + + @Resource + private InHospitalReturnMedicineAppMapper inHospitalReturnMedicineAppMapper; + + @Resource + private ReturnMedicineMapper returnMedicineMapper; + + @Resource + private IMedicationRequestService medicationRequestService; + + @Resource + private IMedicationDispenseService medicationDispenseService; + + @Resource + private IDeviceDispenseService deviceDispenseService; + + @Resource + private IDeviceRequestService deviceRequestService; + + @Resource + private YbManager ybService; + + @Resource + private IChargeItemService iChargeItemService; + + @Resource + private IPaymentReconciliationService iPaymentReconciliationService; + + @Resource + private IContractService iContractService; + + @Resource + private IClinicSettleService clinicSettleService; + + @Resource + private IEncounterDiagnosisService encounterDiagnosisService; + + @Resource + private IAccountService accountService; + + @Resource + private IDeviceDefinitionService deviceDefinitionService; + + @Resource + private IMedicationDefinitionService medicationDefinitionService; + + @Resource + private ReceiptApprovalAppServiceImpl receiptApprovalAppService; + + /** + * 获取页面初始化信息 + * + * @return 初始化信息 + */ + @Override + public R init() { + + ReturnMedicineInitDto initDto = new ReturnMedicineInitDto(); + + // 获取科室下拉选列表 + List organizationList = + iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(), String.valueOf(OrganizationClass.CLINIC.getValue())); + List organizationOptions = organizationList.stream().map( + organization -> new ReturnMedicineInitDto.DepartmentOption(organization.getId(), organization.getName())) + .collect(Collectors.toList()); + + // 发药状态 + List refundStatusOptions = new ArrayList<>(); + refundStatusOptions.add(new ReturnMedicineInitDto.RefundStatusOption(DispenseStatus.PENDING_REFUND.getValue(), + DispenseStatus.PENDING_REFUND.getInfo())); + refundStatusOptions.add(new ReturnMedicineInitDto.RefundStatusOption(DispenseStatus.REFUNDED.getValue(), + DispenseStatus.REFUNDED.getInfo())); + initDto.setDepartmentOptions(organizationOptions).setRefundStatusOptions(refundStatusOptions); + return R.ok(initDto); + } + + /** + * 查询退药患者分页列表 + * + * @param encounterInfoDto 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param request 请求数据 + * @return 退药患者分页列表 + */ + @Override + public R getReturnMedicinePatientPage(EncounterInfoDto encounterInfoDto, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request) { + Integer refundEnum = encounterInfoDto.getRefundEnum(); + encounterInfoDto.setRefundEnum(null); + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(encounterInfoDto, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.IdCard, + CommonConstants.FieldName.PatientPyStr, CommonConstants.FieldName.PatientWbStr)), + request); + // 查询退药患者分页列表 + Page encounterInfoPage = inHospitalReturnMedicineAppMapper.selectEncounterInfoListPage( + new Page<>(pageNo, pageSize), queryWrapper, refundEnum, DispenseStatus.PENDING_REFUND.getValue(), + DispenseStatus.REFUNDED.getValue(), EncounterClass.IMP.getValue(), + CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION); + encounterInfoPage.getRecords().forEach(encounterInfo -> { + // 性别 + encounterInfo.setGenderEnum_enumText( + EnumUtils.getInfoByValue(AdministrativeGender.class, encounterInfo.getGenderEnum())); + // 年龄 + encounterInfo.setAge(AgeCalculatorUtil.getAge(encounterInfo.getBirthDate())); + // 退药状态 + encounterInfo + .setRefundEnum_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, encounterInfo.getRefundEnum())); + }); + return R.ok(encounterInfoPage); + } + + /** + * 查询退药信息 + * + * @param encounterId 就诊ID + * @param refundStatus 退药id + * @param itemTable 项目类型 + * @return 退药信息 + */ + @Override + public R getReturnMedicineInfo(Long encounterId, Integer refundStatus, String itemTable) { + // 获取退药信息 + List returnMedicineInfoList = inHospitalReturnMedicineAppMapper.selectReturnMedicineInfo( + encounterId, CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.MED_MEDICATION_REQUEST, + CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION, + itemTable, refundStatus, DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.REFUNDED.getValue()); + returnMedicineInfoList.forEach(returnMedicineInfoDto -> { + // 退药状态 + returnMedicineInfoDto.setRefundEnum_enumText( + EnumUtils.getInfoByValue(DispenseStatus.class, returnMedicineInfoDto.getRefundEnum())); + // 退药请求状态 + returnMedicineInfoDto.setReqStatus_enumText( + EnumUtils.getInfoByValue(RequestStatus.class, returnMedicineInfoDto.getReqStatus())); + }); + return R.ok(returnMedicineInfoList); + } + + /** + * 退药处理 + * + * @param medicineReturnList 退药清单 + * @return 处理结果 + */ + @Override + public R medicineReturn(List medicineReturnList) { + if (medicineReturnList == null || medicineReturnList.isEmpty()) { + return R.ok(); + } + // 分别处理退药与退耗材的请求 + List returnMedicineList = new ArrayList<>(); + List returnDeviceList = new ArrayList<>(); + // 追溯码列表 + List traceNoManageList = new ArrayList<>(); + TraceNoManage traceNoManage; + + medicineReturnList.forEach(item -> { + switch (item.getTableName()) { + case CommonConstants.TableName.MED_MEDICATION_REQUEST -> returnMedicineList + .add(new ReturnMedicineDto().setDispenseId(item.getDispenseId()).setRequestId(item.getRequestId())); + case CommonConstants.TableName.WOR_DEVICE_REQUEST -> returnDeviceList + .add(new ReturnMedicineDto().setDispenseId(item.getDispenseId()).setRequestId(item.getRequestId())); + } + }); + // 进销存参数 + List supplyItemDetailList = new ArrayList<>(); + + // 处理退药 + // 获取药品退药id列表 + List medReturnIdList = new ArrayList<>(); + if (!returnMedicineList.isEmpty()) { + // 获取药品退药id列表 + medReturnIdList = + returnMedicineList.stream().map(ReturnMedicineDto::getDispenseId).collect(Collectors.toList()); + // 获取药品退药请求id列表 + List medRequestIdList = + returnMedicineList.stream().map(ReturnMedicineDto::getRequestId).collect(Collectors.toList()); + if (medReturnIdList.isEmpty()) { + throw new ServiceException("请选择要退的药品"); + } + if (medRequestIdList.isEmpty()) { + throw new ServiceException("请选择要退的药品"); + } + // 药品退药信息查询 + List refundMedList = medicationDispenseService.listByIds(medReturnIdList); + // 药品退药请求查询 + List refundMedRequestList = medicationRequestService.listByIds(medRequestIdList); + if (refundMedList == null || refundMedList.isEmpty()) { + throw new ServiceException("请选择要退的药品"); + } + // 重复退药校验 + if (refundMedList.stream().map(MedicationDispense::getStatusEnum) + .anyMatch(x -> x.equals(DispenseStatus.REFUNDED.getValue()))) { + throw new ServiceException("药品已退药,请勿重复退药"); + } + + // 更新退药单 + for (MedicationDispense medicationDispense : refundMedList) { + // 退药状态 + medicationDispense.setStatusEnum(DispenseStatus.REFUNDED.getValue()); + // 退药数量 + medicationDispense.setDispenseQuantity(medicationDispense.getQuantity()); + // 状态变更时间 + medicationDispense.setStatusChangedTime(DateUtils.getNowDate()); + // 退药时间 + medicationDispense.setDispenseTime(DateUtils.getNowDate()); + // 退药人 + medicationDispense.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); + + // 设置库存变更参数 + SupplyItemDetailDto supplyItemDetailDto = new SupplyItemDetailDto(); + for (MedicationRequest medicationRequest : refundMedRequestList) { + // 根据退药id查询退药请求id(用于医保关联) + if (medicationDispense.getMedReqId().equals(medicationRequest.getId())) { + supplyItemDetailDto.setRequestId(medicationRequest.getRefundMedicineId()); + } + } + supplyItemDetailDto.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION) + .setItemId(medicationDispense.getMedicationId()).setLotNumber(medicationDispense.getLotNumber()); + supplyItemDetailList.add(supplyItemDetailDto); + + // 追溯码表相关处理 + if (medicationDispense.getTraceNo() != null) { + // 使用逗号分割追溯码并转换为List + String[] traceNoList = medicationDispense.getTraceNo().split(CommonConstants.Common.COMMA); + for (String item : traceNoList) { + traceNoManage = new TraceNoManage(); + // 追溯码处理 + traceNoManage.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION) + // 项目id + .setItemId(medicationDispense.getMedicationId()) + // 仓库类型 + .setLocationTypeEnum(null) + // 仓库 + .setLocationId(medicationDispense.getLocationId()) + // 仓位 + .setLocationStoreId(null) + // 产品批号 + .setLotNumber(medicationDispense.getLotNumber()) + // 追溯码 + .setTraceNo(item) + // 追溯码状态 + .setStatusEnum(TraceNoStatus.IN.getValue()) + // 追溯码单位 + .setUnitCode(medicationDispense.getUnitCode()) + // 操作类型 + .setOperationType(SupplyType.RETURN_MEDICATION.getValue()); + traceNoManageList.add(traceNoManage); + } + } + } + // 退药更新 + medicationDispenseService.updateBatchById(refundMedList); + } + + // 处理退耗材 + // 获取退耗材id列表 + List devReturnIdList = new ArrayList<>(); + if (!returnDeviceList.isEmpty()) { + // 获取退耗材id列表 + devReturnIdList = + returnDeviceList.stream().map(ReturnMedicineDto::getDispenseId).collect(Collectors.toList()); + // 获取退耗材请求id列表 + List devRequestIdList = returnDeviceList.stream().map(ReturnMedicineDto::getRequestId).toList(); + if (devReturnIdList.isEmpty()) { + throw new ServiceException("请选择要退的耗材"); + } + if (devRequestIdList.isEmpty()) { + throw new ServiceException("请选择要退的耗材"); + } + // 退耗材信息查询 + List refundDevList = deviceDispenseService.listByIds(devReturnIdList); + if (refundDevList == null || refundDevList.isEmpty()) { + throw new ServiceException("请选择要退的耗材"); + } + // 重复退耗材校验 + if (refundDevList.stream().map(DeviceDispense::getStatusEnum) + .anyMatch(x -> x.equals(DispenseStatus.REFUNDED.getValue()))) { + throw new ServiceException("耗材已退,请勿重复操作"); + } + // 更新退耗材单状态 + for (DeviceDispense deviceDispense : refundDevList) { + // 退药时间 + deviceDispense.setDispenseTime(DateUtils.getNowDate()); + // 退药数量 + deviceDispense.setDispenseQuantity(deviceDispense.getQuantity()); + // 退药状态 + deviceDispense.setStatusEnum(DispenseStatus.REFUNDED.getValue()); + // 设置库存变更参数 + supplyItemDetailList + .add(new SupplyItemDetailDto().setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION) + .setItemId(deviceDispense.getDeviceDefId()).setLotNumber(deviceDispense.getLotNumber())); + // // 使用逗号分割追溯码并转换为List + // String[] traceNoList = deviceDispense.getTraceNo().split(CommonConstants.Common.COMMA); + // for (String item : traceNoList) { + // traceNoManage = new TraceNoManage(); + // // 追溯码处理 + // traceNoManage.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION) + // // 项目id + // .setItemId(deviceDispense.getDeviceDefId()) + // // 仓库类型 + // .setLocationTypeEnum(LocationForm.PHARMACY.getValue()) + // // 仓库 + // .setLocationId(deviceDispense.getLocationId()) + // // 产品批号 + // .setLotNumber(deviceDispense.getLotNumber()) + // // 追溯码 + // .setTraceNo(item) + // // 追溯码状态 + // .setStatusEnum(TraceNoStatus.IN.getValue()) + // // 追溯码单位 + // .setUnitCode(deviceDispense.getUnitCode()) + // // 操作类型 + // .setOperationType(SupplyType.RETURN_MEDICATION.getValue()); + // traceNoManageList.add(traceNoManage); + // } + } + deviceDispenseService.updateBatchById(refundDevList); + } + + // 追溯码管理表数据追加 + traceNoManageService.saveBatch(traceNoManageList); + + // 处理退库存 + // 获取库存信息 + List unDispenseInventoryList = + returnMedicineMapper.selectInventoryInfoList(devReturnIdList, medReturnIdList, + CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION); + // 库存待更新列表 + List inventoryItemList = new ArrayList<>(); + // 根据批号,发放项目,发放药房进行分组处理 + Map> unDispenseInventoryMap = + unDispenseInventoryList.stream().collect(Collectors.groupingBy(x -> x.getItemId() + + CommonConstants.Common.DASH + x.getLotNumber() + CommonConstants.Common.DASH + x.getLocationId())); + if (!unDispenseInventoryMap.isEmpty()) { + for (Map.Entry> entry : unDispenseInventoryMap.entrySet()) { + List inventoryList = entry.getValue(); + if (!inventoryList.isEmpty()) { + // 最小单位数量 + BigDecimal minQuantity = BigDecimal.ZERO; + + for (UnDispenseInventoryDto unDispenseInventoryDto : inventoryList) { + BigDecimal quantity = unDispenseInventoryDto.getQuantity(); + if (!unDispenseInventoryDto.getDispenseUnit() + .equals(unDispenseInventoryDto.getInventoryUnitCode())) { + // 转换为小单位进行累加 + quantity = + unDispenseInventoryDto.getQuantity().multiply(unDispenseInventoryDto.getPartPercent()); + } + minQuantity = minQuantity.add(quantity); + } + // 理论上不出bug的情况下以项目id,批号,仓库进行分组处理库存一定唯一所以get(0) + // 设置待更新的库存信息 + inventoryItemList.add(new InventoryItem().setId(inventoryList.get(0).getInventoryId()) + .setQuantity(inventoryList.get(0).getInventoryQuantity().add(minQuantity))); + } + } + // 库存更新 + iInventoryItemService.updateBatchById(inventoryItemList); + } else { + throw new ServiceException("请检查库存信息"); + } + + // 处理退药医保 + // 返回信息 + String returnMsg = null; + List uploadFailedNoList; + // 调用医保商品销售退货接口 + String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 + if (Whether.YES.getCode().equals(ybSwitch)) { + List deviceDefinitions = new ArrayList<>(); + List medicationDefinitions = new ArrayList<>(); + if (!returnMedicineList.isEmpty()) { + // 设置进销存参数 + medicationDefinitions = medicationDefinitionService.listByIds(supplyItemDetailList.stream() + .filter(x -> x.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION)) + .map(SupplyItemDetailDto::getItemId).collect(Collectors.toList())); + } + if (!returnDeviceList.isEmpty()) { + deviceDefinitions = deviceDefinitionService.listByIds(supplyItemDetailList.stream() + .filter(x -> x.getItemTable().equals(CommonConstants.TableName.ADM_DEVICE_DEFINITION)) + .map(SupplyItemDetailDto::getItemId).collect(Collectors.toList())); + } + + // 创建映射表,添加空集合保护 + Map medicationMap = + medicationDefinitions != null ? medicationDefinitions.stream().filter(Objects::nonNull) + .collect(Collectors.toMap(MedicationDefinition::getId, Function.identity())) : new HashMap<>(); + + Map deviceMap = + deviceDefinitions != null ? deviceDefinitions.stream().filter(Objects::nonNull) + .collect(Collectors.toMap(DeviceDefinition::getId, Function.identity())) : new HashMap<>(); + + // 设置库存变更参数,添加完整判空 + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + if (supplyItemDetailDto == null) + continue; + if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(supplyItemDetailDto.getItemTable())) { + if (supplyItemDetailDto.getItemId() != null) { + MedicationDefinition med = medicationMap.get(supplyItemDetailDto.getItemId()); + if (med != null) { + supplyItemDetailDto.setItemBusNo(med.getBusNo()).setPartPercent(med.getPartPercent()) + .setRxFlag(med.getRxFlag()).setYbNo(med.getYbNo()); + } + } + } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(supplyItemDetailDto.getItemTable())) { + if (supplyItemDetailDto.getItemId() != null) { + DeviceDefinition dev = deviceMap.get(supplyItemDetailDto.getItemId()); + if (dev != null) { + supplyItemDetailDto.setItemBusNo(dev.getBusNo()).setPartPercent(dev.getPartPercent()) + .setRxFlag(dev.getRxFlag()).setYbNo(dev.getYbNo()); + } + } + } + } + uploadFailedNoList = this.ybReturnIntegrated(medReturnIdList, null); + uploadFailedNoList = receiptApprovalAppService.ybInventoryIntegrated(supplyItemDetailList, + YbInvChgType.OTHER_OUT, DateUtils.getNowDate(), true); + if (uploadFailedNoList != null) { + returnMsg = "3506商品销售退货上传错误,错误项目编码" + uploadFailedNoList; + } else { + returnMsg = "3506商品销售退货上传成功"; + } + } + // 返回退药成功信息 + return R.ok(returnMsg, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"退药"})); + } + + /** + * 医保退药相关进销存接口 + * + * @param dispenseMedIdList 退药id列表 + * @param dispenseDevIdList 退耗材id列表 + * @return 上传失败的编号集合 + */ + public List ybReturnIntegrated(List dispenseMedIdList, List dispenseDevIdList) { + List uploadFailedNoList = new ArrayList<>(); + R result; + if (!dispenseMedIdList.isEmpty() || !dispenseDevIdList.isEmpty()) { + // 查询退药项目相关信息 + List dispenseInventoryList = returnMedicineMapper.selectReturnItemDetail( + dispenseDevIdList, dispenseMedIdList, CommonConstants.TableName.MED_MEDICATION_DEFINITION, + CommonConstants.TableName.ADM_DEVICE_DEFINITION); + for (DispenseInventoryDto dispenseInventoryDto : dispenseInventoryList) { + if (dispenseInventoryDto.getYbNo() == null) { + continue; + } + Pair medical3506Pair = getMedical3506Param(dispenseInventoryDto); + // 如果自费则自动取省医保 + Contract contract = medical3506Pair.getRight(); + if (contract != null) { + if (CommonConstants.BusinessName.DEFAULT_CONTRACT_NO + .equals(medical3506Pair.getRight().getBusNo())) { + contract = null; + } + } + result = ybService.cancelMerchandise(medical3506Pair.getLeft(), contract); + if (result.getCode() != 200) { + uploadFailedNoList.add(dispenseInventoryDto.getDispenseNo()); + } + } + } + return uploadFailedNoList; + } + + private Pair getMedical3506Param(DispenseInventoryDto dispenseInventoryDto) { + Medical3506Param medical3506Param = new Medical3506Param(); + ChargeItem chargeItem = null; + if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dispenseInventoryDto.getItemTable())) { + // 查询费用结算信息 + chargeItem = iChargeItemService.getOne(new LambdaQueryWrapper() + .eq(ChargeItem::getServiceTable, CommonConstants.TableName.MED_MEDICATION_REQUEST) + .eq(ChargeItem::getServiceId, dispenseInventoryDto.getRefundId()) + .eq(ChargeItem::getTenantId, SecurityUtils.getLoginUser().getTenantId())); + } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dispenseInventoryDto.getItemTable())) { + chargeItem = iChargeItemService.getOne(new LambdaQueryWrapper() + .eq(ChargeItem::getServiceTable, CommonConstants.TableName.WOR_DEVICE_REQUEST) + .eq(ChargeItem::getServiceId, dispenseInventoryDto.getRefundId()) + .eq(ChargeItem::getTenantId, SecurityUtils.getLoginUser().getTenantId())); + } + if (chargeItem == null) { + throw new ServiceException("未查询到收费项"); + } + // 查询就诊诊断信息 + EncounterDiagnosis encounterDiagnosis = encounterDiagnosisService.getById(chargeItem.getEncounterDiagnosisId()); + if (encounterDiagnosis == null) { + throw new ServiceException("未查找到就诊诊断信息"); + } + // 查询付款信息 + PaymentReconciliation paymentReconciliation = + iPaymentReconciliationService.getOne(new LambdaQueryWrapper() + .eq(PaymentReconciliation::getEncounterId, chargeItem.getEncounterId()) + .like(PaymentReconciliation::getChargeItemIds, chargeItem.getId()) + .eq(PaymentReconciliation::getStatusEnum, PaymentStatus.SUCCESS.getValue()) + .eq(PaymentReconciliation::getPatientId, chargeItem.getPatientId()) + .eq(PaymentReconciliation::getPaymentEnum, PaymentType.PAY.getValue())); + if (paymentReconciliation == null) { + throw new ServiceException("未查询到收费"); + } + + // 查询账户信息 + Account account = accountService + .getOne(new LambdaQueryWrapper().eq(Account::getEncounterId, chargeItem.getEncounterId()) + .eq(Account::getEncounterFlag, Whether.YES.getValue())); + if (account == null) { + throw new ServiceException("未查询到账户"); + } + // 查询合同实体 + Contract contract = + iContractService.getOne(new LambdaQueryWrapper().eq(Contract::getBusNo, account.getContractNo())); + if (contract == null) { + throw new ServiceException("未查询到合同信息"); + } + YbMdtrtCertType mdtrtCertType; + if (AccountType.PERSONAL_CASH_ACCOUNT.getCode().equals(account.getTypeCode())) { + mdtrtCertType = YbMdtrtCertType.MDTRT_CERT_TYPE02; + } else { + mdtrtCertType = YbMdtrtCertType.getByValue(account.getTypeCode());// 2025/05/28 该值存01/02/03 + } + if (mdtrtCertType == null) { + throw new ServiceException("未查询到电子凭证"); + } + // 查询就诊id + if (contract.getCategoryEnum().equals(Category.SELF.getValue()) + || contract.getCategoryEnum().equals(Category.PUBLIC.getValue())) { + medical3506Param.setMdtrtSn(dispenseInventoryDto.getEncounterNo()); + } else { + ClinicSettle clinicSettle = clinicSettleService.getOne(new LambdaQueryWrapper() + .in(ClinicSettle::getSetlId, List.of(paymentReconciliation.getYbSettleIds())) + .eq(ClinicSettle::getMedType, encounterDiagnosis.getMedTypeCode()).last(" LIMIT 1")); + if (clinicSettle != null) { + medical3506Param.setMdtrtSn(clinicSettle.getMdtrtId()); + } else { + medical3506Param.setMdtrtSn(dispenseInventoryDto.getEncounterNo()); + } + } + // // 查询发票信息 + // Invoice invoice = iInvoiceService.getById(paymentReconciliation.getInvoiceId()); + // if (invoice == null) { + // throw new ServiceException("未查询到发票信息"); + // } + // 转换为JSON + JSONArray medicalTraceNo = new JSONArray(); + // 获取追溯码信息 + if (dispenseInventoryDto.getTraceNo() != null) { + List traceNoList = + Arrays.stream(dispenseInventoryDto.getTraceNo().split(CommonConstants.Common.COMMA)).map(String::trim) + .filter(s -> !s.isEmpty()).toList(); + for (String traceNo : traceNoList) { + Map traceNoMap = new HashMap<>(); + traceNoMap.put("drug_trac_codg", traceNo); + medicalTraceNo.add(traceNoMap); + } + } + medical3506Param.setMedListCodg(dispenseInventoryDto.getYbNo()) + .setFixmedinsBchno(dispenseInventoryDto.getRefundId().toString()) + .setFixmedinsHilistId(dispenseInventoryDto.getItemNo()) + .setFixmedinsHilistName(CommonConstants.TableName.MED_MEDICATION_DEFINITION) + .setPsnCertType(mdtrtCertType.getValue()).setManuLotnum(dispenseInventoryDto.getLotNumber()) + .setManuDate(dispenseInventoryDto.getProductionDate()) + .setSelRetnCnt(new BigDecimal(dispenseInventoryDto.getDispenseQuantity().toString())) + .setSelRetnTime(dispenseInventoryDto.getDispenseTime()).setExpyEnd(dispenseInventoryDto.getExpirationDate()) + .setDrugtracinfo(medicalTraceNo).setCertno(dispenseInventoryDto.getIdCard()); + // 查看所属医院 + String fixmedinsCode = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); + if (dispenseInventoryDto.getPreparerName() == null && HospitalCodeEnum.CCU.getCode().equals(fixmedinsCode)) { + medical3506Param.setSelRetnOpterName(CommonConstants.CCU.DisDeviceDoctorName); + } else { + medical3506Param.setSelRetnOpterName(dispenseInventoryDto.getPreparerName()); + } + if (dispenseInventoryDto.getInventoryUnitCode().equals(dispenseInventoryDto.getDispenseUnitCode())) { + medical3506Param.setTrdnFlag(Whether.YES.getCode()); + } else { + medical3506Param.setTrdnFlag(Whether.NO.getCode()); + } + if (YbRxFlag.IMPORTANT_HERBAL_SLICES.getCode() == dispenseInventoryDto.getRxFlag()) { + medical3506Param.setRxFlag(YbRxFlag.IMPORTANT_HERBAL_SLICES.getName()); + } else if (YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getCode() == dispenseInventoryDto.getRxFlag()) { + medical3506Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } else if (YbRxFlag.SELF_PREPARED_MEDICATION.getCode() == dispenseInventoryDto.getRxFlag()) { + medical3506Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } + if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dispenseInventoryDto.getItemTable())) { + medical3506Param.setFixmedinsHilistName(CommonConstants.TableName.MED_MEDICATION_DEFINITION); + } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dispenseInventoryDto.getItemTable())) { + medical3506Param.setFixmedinsHilistName(CommonConstants.TableName.ADM_DEVICE_DEFINITION); + } + return Pair.of(medical3506Param, contract); + } + + private MedicalInventory3511Param getMedical3511Param(DispenseInventoryDto dispenseInventoryDto) { + MedicalInventory3511Param medicalInventory3511Param = new MedicalInventory3511Param(); + + String fixmedinsCode = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); + // TODO + medicalInventory3511Param.setFixmedinsCode(fixmedinsCode).setMedinsListCodg(dispenseInventoryDto.getYbNo()) + .setFixmedinsBchno(dispenseInventoryDto.getLotNumber()).setBegndate(dispenseInventoryDto.getDispenseTime()) + .setEnddate(dispenseInventoryDto.getDispenseTime()); + + return medicalInventory3511Param; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PrescriptionReviewAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PrescriptionReviewAppServiceImpl.java new file mode 100644 index 00000000..a27e9de4 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PrescriptionReviewAppServiceImpl.java @@ -0,0 +1,266 @@ +package com.openhis.web.pharmacymanage.appservice.impl; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.core.common.core.domain.R; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.NewExcelUtil; +import com.core.common.utils.SecurityUtils; +import com.core.common.utils.StringUtils; +import com.core.common.utils.bean.BeanUtils; +import com.openhis.administration.domain.PrescriptionReviewRecord; +import com.openhis.administration.dto.PrescriptionReviewRecordDto; +import com.openhis.administration.service.IPrescriptionReviewRecordService; +import com.openhis.common.enums.AdministrativeGender; +import com.openhis.common.enums.EncounterClass; +import com.openhis.common.enums.ReviewReasonEnum; +import com.openhis.common.enums.ReviewReasonableStatus; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.common.utils.PageUtils; +import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto; +import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto; +import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper; +import com.openhis.web.pharmacymanage.appservice.IPrescriptionReviewAppService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 处方审方 应用实现类 + * + * @author swb + * @date 2026/1/30 + */ +@Slf4j +@Service +public class PrescriptionReviewAppServiceImpl implements IPrescriptionReviewAppService { + + @Autowired + IPrescriptionReviewRecordService prescriptionReviewRecordService; + + @Autowired + DoctorStationMainAppMapper doctorStationMainAppMapper; + + /** + * 审方 + * + * @param recordDto 处方审方记录dto + * @return 是否成功 + */ + @Override + public R review(PrescriptionReviewRecordDto recordDto) { + if (recordDto.getEncounterId() == null) { + return R.fail("就诊id不能为空"); + } + if (recordDto.getPrescriptionNo() == null) { + return R.fail("处方号不能为空"); + } + if (recordDto.getReasonableFlag() == null) { + return R.fail("是否合理标识不能为空"); + } + List prescriptionDetailInfo = doctorStationMainAppMapper + .getPrescriptionDetailInfo(recordDto.getPrescriptionNo(), recordDto.getEncounterId()); + List requestIds = prescriptionDetailInfo.stream().map(PrescriptionInfoDetailDto::getRequestId).toList(); + recordDto.setMedRequestIds(StringUtils.join(requestIds, ",")); + recordDto.setPractitioner(SecurityUtils.getLoginUser().getPractitionerId()); + boolean review = prescriptionReviewRecordService.review(recordDto); + if (!review) { + return R.fail("审方失败"); + } + return R.ok("审方成功"); + } + + /** + * 获取处方审方记录列表 + * + * @param prescriptionNoList 处方号集合 + * @param reviewStatus 审方状态 + * @return 处方审方记录列表 + */ + @Override + public List getPrescriptionReviewRecords(List prescriptionNoList, + Integer reviewStatus) { + List prescriptionReviewRecords = + prescriptionReviewRecordService.getPrescriptionReviewRecords(prescriptionNoList, null, null, reviewStatus); + return prescriptionReviewRecords.stream().map(e -> { + PrescriptionReviewRecordDto prescriptionReviewRecordDto = new PrescriptionReviewRecordDto(); + prescriptionReviewRecordDto.setPractitioner(e.getPractitionerId()); + BeanUtils.copyProperties(e, prescriptionReviewRecordDto); + return prescriptionReviewRecordDto; + }).toList(); + } + + /** + * 获取处方审方记录分页列表 + * + * @param doctorId 医生id + * @param reviewStatus 审方状态 + * @param patientName 患者姓名 + * @param request 请求 + * @return 处方审方记录分页列表 + */ + public List getPrescriptionReviewInfo(Long doctorId, Integer reviewStatus, + String patientName, HttpServletRequest request) { + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(new PrescriptionInfoBaseDto().setPractitionerId(doctorId), patientName, + new HashSet<>(List.of("patient_name")), request); + List prescriptionInfos = + doctorStationMainAppMapper.getPrescriptionInfos(queryWrapper, EncounterClass.AMB.getValue()); + // 处方列表为空时直接返回空集合 + if (prescriptionInfos == null || prescriptionInfos.isEmpty()) { + return List.of(); + } + // 处方号列表 + List prescriptionNoList = + prescriptionInfos.stream().map(PrescriptionInfoBaseDto::getPrescriptionNo).toList(); + // 本次就诊的处方信息 + List prescriptionDetailInfo = + doctorStationMainAppMapper.getPrescriptionDetailInfoByPrescriptionNo(prescriptionNoList); + for (PrescriptionInfoBaseDto infoBaseDto : prescriptionInfos) { + // 性别 + infoBaseDto.setGenderEnum_enumText( + EnumUtils.getInfoByValue(AdministrativeGender.class, infoBaseDto.getGenderEnum())); + // 计算年龄 + infoBaseDto + .setAge(infoBaseDto.getBirthDate() != null ? AgeCalculatorUtil.getAge(infoBaseDto.getBirthDate()) : ""); + // 处方单详情 + List prescriptionInfoDetailList = prescriptionDetailInfo.stream() + .filter(e -> infoBaseDto.getPrescriptionNo().equals(e.getPrescriptionNo())) + .collect(Collectors.toList()); + infoBaseDto.setPrescriptionInfoDetailList(prescriptionInfoDetailList); + } + + if (!prescriptionInfos.isEmpty()) { + List prescriptionReviewRecords = + getPrescriptionReviewRecords(prescriptionNoList, reviewStatus); + if (reviewStatus != null) { + // 处方审方记录 + if (prescriptionReviewRecords != null && !prescriptionReviewRecords.isEmpty()) { + List prescriptionNos = + prescriptionReviewRecords.stream().map(PrescriptionReviewRecordDto::getPrescriptionNo).toList(); + // 根据是否合理筛选 + prescriptionInfos = prescriptionInfos.stream() + .filter(e -> prescriptionNos.contains(e.getPrescriptionNo())).toList(); + } + } + // 根据处方号分组 + Map> prescriptionMap; + if (prescriptionReviewRecords != null && !prescriptionReviewRecords.isEmpty()) { + prescriptionMap = prescriptionReviewRecords.stream() + .collect(Collectors.groupingBy(PrescriptionReviewRecordDto::getPrescriptionNo)); + } else { + prescriptionMap = null; + } + prescriptionInfos.forEach(record -> { + if (prescriptionMap != null && prescriptionMap.containsKey(record.getPrescriptionNo())) { + PrescriptionReviewRecordDto prescription = prescriptionMap.get(record.getPrescriptionNo()).get(0); + // 审方ID + record.setPrescriberReviewId(prescription.getId()); + // 审方人 + record.setReviewer(prescription.getPractitioner()); + // 是否合理 + record.setIsReasonable(prescription.getReasonableFlag()); + // 存在问题 + record.setReasonEnum(prescription.getReasonEnum()); + record.setReasonEnum_enumText(ReviewReasonEnum.getByValue(prescription.getReasonEnum())); + // 其他问题 + record.setReason(prescription.getReasonText()); + } else { + // 是否合理:设置为待点评 + record.setIsReasonable(ReviewReasonableStatus.TO_BE_COMMENTED.getValue()); + // 审方人 + // record.setReviewer(SecurityUtils.getLoginUser().getPractitionerId()); + } + List detailList = record.getPrescriptionInfoDetailList(); + if (detailList != null && !detailList.isEmpty()) { + // 基药数量 + int baseDrugQuantity = detailList.stream().filter(e -> e.getBasicFlag() == 1).toList().size(); + // 抗菌药数量 + int antibioticQuantity = + detailList.stream().filter(e -> e.getAntibioticFlag() == 1).toList().size(); + // 注射剂数量 + int injectionQuantity = detailList.stream().filter(e -> e.getInjectFlag() == 1).toList().size(); + // 是否包含抗菌药 + boolean antibioticFlag = antibioticQuantity > 0; + // 是否包含注射剂 + boolean injectFlag = injectionQuantity > 0; + // 药品品种数量 + int drugVarietyQuantity = detailList.stream() + .collect(Collectors.groupingBy(PrescriptionInfoDetailDto::getAdviceName)).size(); + // 处方总金额 + BigDecimal totalAmount = detailList.stream().map(PrescriptionInfoDetailDto::getTotalPrice) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + + // 是否包含注射药品 + record.setIsIncludeInjections(injectFlag); + // 是否包含抗生素 + record.setIsContainAntibiotics(antibioticFlag); + // 基药数量 + record.setBaseDrugQuantity(baseDrugQuantity); + // 抗菌药数量 + record.setAntibioticQuantity(antibioticQuantity); + // 注射剂数量 + record.setInjectionQuantity(injectionQuantity); + // 药品品种数量 + record.setDrugVarietyQuantity(drugVarietyQuantity); + // 处方总金额 + record.setTotalAmount(totalAmount); + } + }); + } + return prescriptionInfos; + } + + /** + * 查询处方审核信息(分页) + * + * @param doctorId 医生id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 处方审核信息 + */ + @Override + public R getPrescriptionReviewPageInfo(Long doctorId, Integer reviewStatus, String patientName, Integer pageNo, + Integer pageSize, HttpServletRequest request) { + List prescriptionInfos = + getPrescriptionReviewInfo(doctorId, reviewStatus, patientName, request); + prescriptionInfos.sort(Comparator.comparing(PrescriptionInfoBaseDto::getRequestTime).reversed()); + return R.ok(PageUtils.buildPage(prescriptionInfos, pageNo, pageSize)); + } + + /** + * 导出处方审核信息 + * + * @param doctorId 医生id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param request 请求 + * @param response 响应 + */ + @Override + public void makeFile(Long doctorId, Integer reviewStatus, String patientName, HttpServletRequest request, + HttpServletResponse response) { + List prescriptionInfos = + getPrescriptionReviewInfo(doctorId, reviewStatus, patientName, request); + if (prescriptionInfos != null && !prescriptionInfos.isEmpty()) { + try { + NewExcelUtil excelUtil = new NewExcelUtil<>(PrescriptionInfoBaseDto.class); + excelUtil.exportExcel(response, prescriptionInfos, "处方审核信息"); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InHospitalReturnMedicineController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InHospitalReturnMedicineController.java new file mode 100644 index 00000000..36950308 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/InHospitalReturnMedicineController.java @@ -0,0 +1,89 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.pharmacymanage.controller; + +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.web.pharmacymanage.appservice.IInHospitalReturnMedicineAppService; +import com.openhis.web.pharmacymanage.dto.EncounterInfoDto; +import com.openhis.web.pharmacymanage.dto.ReturnMedicineDto; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * TODO:概括描述当前类的主要用途和注意事项 + * + * @author zwh + * @date 2025-12-29 + */ +@RestController +@RequestMapping("/pharmacy-manage/inHospital-return-medicine") +@Slf4j +@AllArgsConstructor +public class InHospitalReturnMedicineController { + + @Resource + public IInHospitalReturnMedicineAppService inHospitalReturnMedicineAppService; + + /** + * 获取页面初始化信息 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R returnMedicineInit() { + return inHospitalReturnMedicineAppService.init(); + } + + /** + * 查询退药患者分页列表 + * + * @param encounterInfoDto 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param request 请求数据 + * @return 退药患者分页列表 + */ + @GetMapping(value = "/return-patient-page") + public R getReturnMedicinePatientPage(EncounterInfoDto encounterInfoDto, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return inHospitalReturnMedicineAppService.getReturnMedicinePatientPage(encounterInfoDto, searchKey, pageNo, + pageSize, request); + } + + /** + * 查询退药信息 + * + * @param encounterId 就诊ID + * @param refundStatus 退药id + * @param itemTable 项目类型 + * @return 退药信息 + */ + @GetMapping("/medicine-return-list") + public R getReturnMedicineInfo(@RequestParam Long encounterId, @RequestParam Integer refundStatus, + String itemTable) { + return inHospitalReturnMedicineAppService.getReturnMedicineInfo(encounterId, refundStatus, itemTable); + } + + /** + * 退药处理 + * + * @param medicineReturnList 退药清单 + * @return 处理结果 + */ + @PutMapping("/medicine-return") + public R medicineReturn(@RequestBody List medicineReturnList) { + return inHospitalReturnMedicineAppService.medicineReturn(medicineReturnList); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/PrescriptionReviewController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/PrescriptionReviewController.java new file mode 100644 index 00000000..78af46b0 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/controller/PrescriptionReviewController.java @@ -0,0 +1,80 @@ +package com.openhis.web.pharmacymanage.controller; + +/** + * 处方审方Controller + * + * @author swb + * @date 2026/1/30 + */ + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.administration.dto.PrescriptionReviewRecordDto; +import com.openhis.web.pharmacymanage.appservice.IPrescriptionReviewAppService; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 处方审方Controller + */ +@RestController +@RequestMapping("/pharmacy-manage/prescription-review") +@Slf4j +@AllArgsConstructor +public class PrescriptionReviewController { + @Autowired + private IPrescriptionReviewAppService prescriptionReviewAppService; + + /** + * 审方 + * + * @param recordDto 审方记录dto + * @return 是否成功 + */ + @PostMapping("/review") + public R review(@RequestBody PrescriptionReviewRecordDto recordDto) { + return prescriptionReviewAppService.review(recordDto); + } + + /** + * 查询处方审核信息 + * + * @param practitionerId 参与者id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 处方审核信息 + */ + @GetMapping(value = "/info") + public R getPrescriptionReviewInfo(@RequestParam(required = false) Long practitionerId, + @RequestParam(required = false) Integer reviewStatus, @RequestParam(required = false) String patientName, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return prescriptionReviewAppService.getPrescriptionReviewPageInfo(practitionerId, reviewStatus, patientName, + pageNo, pageSize, request); + } + + /** + * 处方点评导出 + * + * @param practitionerId 参与者id + * @param reviewStatus 审核状态 + * @param patientName 患者姓名 + * @param request 请求 + * @param response 响应 + */ + @GetMapping(value = "/export") + public void makeFile(@RequestParam(required = false) Long practitionerId, + @RequestParam(required = false) Integer reviewStatus, @RequestParam(required = false) String patientName, + HttpServletRequest request, HttpServletResponse response) { + prescriptionReviewAppService.makeFile(practitionerId, reviewStatus, patientName, request, response); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/JlauDispenseParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/JlauDispenseParam.java new file mode 100644 index 00000000..a9dd435f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/JlauDispenseParam.java @@ -0,0 +1,33 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.pharmacymanage.dto; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 农大门诊配/发药 参数类 + * + */ +@Data +@Accessors(chain = true) +public class JlauDispenseParam { + + /** + * 配/发药信息 + */ + private List dispenseMedicineList; + + /** + * UI选择的发药时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date dispenseTime; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InHospitalReturnMedicineAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InHospitalReturnMedicineAppMapper.java new file mode 100644 index 00000000..47f48360 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/InHospitalReturnMedicineAppMapper.java @@ -0,0 +1,66 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.pharmacymanage.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.pharmacymanage.dto.EncounterInfoDto; +import com.openhis.web.pharmacymanage.dto.ReturnMedicineInfoDto; + +/** + * TODO:概括描述当前类的主要用途和注意事项 + * + * @author zwh + * @date 2025-12-29 + */ +@Repository +public interface InHospitalReturnMedicineAppMapper { + + /** + * 查询退药患者分页列表 + * + * @param page 分页 + * @param queryWrapper 查询条件 + * @param refundStatus 退药状态 + * @param pendingRefund 退药状态:待退药 + * @param refunded 退药状态:已退药 + * @param imp 患者类型:住院 + * @param medMedicationDefinition 药品表 + * @param admDeviceDefinition 耗材表 + * @return 退药患者分页列表 + */ + Page selectEncounterInfoListPage(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper, + @Param("refundStatus") Integer refundStatus, @Param("pendingRefund") Integer pendingRefund, + @Param("refunded") Integer refunded, @Param("imp") Integer imp, + @Param("medMedicationDefinition") String medMedicationDefinition, + @Param("admDeviceDefinition") String admDeviceDefinition); + + /** + * 申请退药清单查询 + * + * @param encounterId 就诊ID + * @param medMedicationRequest 药品请求表 + * @param worDeviceRequest 耗材请求表 + * @param medMedicationDefinition 药品表 + * @param admDeviceDefinition 耗材表 + * @param itemTable 项目所在表 + * @param refundStatus 退药状态 + * @param pendingRefund 退药状态:待退药 + * @param refunded 退药状态:已退药 + * @return 申请退药清单 + */ + List selectReturnMedicineInfo(@Param("encounterId") Long encounterId, + @Param("worDeviceRequest") String worDeviceRequest, @Param("medMedicationRequest") String medMedicationRequest, + @Param("medMedicationDefinition") String medMedicationDefinition, + @Param("admDeviceDefinition") String admDeviceDefinition, @Param("itemTable") String itemTable, + @Param("refundStatus") Integer refundStatus, @Param("pendingRefund") Integer pendingRefund, + @Param("refunded") Integer refunded); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IAmbAdviceStatisticsAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IAmbAdviceStatisticsAppService.java new file mode 100644 index 00000000..669c781d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IAmbAdviceStatisticsAppService.java @@ -0,0 +1,71 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.core.common.core.domain.R; + +/** + * 门诊医嘱统计 appService + * + * @author GYY + * @date 2025-04-22 + */ +public interface IAmbAdviceStatisticsAppService { + + /** + * 查询门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊药品医嘱统计 + */ + R getMedStatistics(String startTime, String endTime, String contractNo, String patientName, Long openOrgId); + + /** + * 导出 门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + void exportMedExcel(String startTime, String endTime, String contractNo, String patientName, Long openOrgId, + HttpServletRequest request, HttpServletResponse response); + + /** + * 查询门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊诊疗医嘱统计 + */ + R getActStatistics(String startTime, String endTime, String contractNo, String patientName, Long openOrgId); + + /** + * 导出 门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + void exportActExcel(String startTime, String endTime, String contractNo, String patientName, Long openOrgId, + HttpServletRequest request, HttpServletResponse response); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IOutpatientManageReportAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IOutpatientManageReportAppService.java new file mode 100644 index 00000000..7649a162 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IOutpatientManageReportAppService.java @@ -0,0 +1,37 @@ +package com.openhis.web.reportmanage.appservice; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.dto.OutpatientManageParam; + +/** + * 门诊记录相关报表 appservice + * + * @author swb + * @date 2026/2/27 + */ +public interface IOutpatientManageReportAppService { + /** + * 门诊就诊记录初始化 + * + * @return 门诊就诊记录数据 + */ + R init(); + + /** + * 获取门诊就诊记录分页数据 + * + * @param outpatientManageParam 查询参数 + * @param searchKey 模糊查询条件 + * @param pageNo 页码 + * @param pageSize 每页数量 + * @param request 请求 + * @return 门诊就诊记录分页数据 + */ + R getOutpatientRecordPage(OutpatientManageParam outpatientManageParam, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); + + void ExportExcel(OutpatientManageParam outpatientManageParam, String searchKey, HttpServletRequest request, HttpServletResponse response); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IPharmacySettlementReportAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IPharmacySettlementReportAppService.java new file mode 100644 index 00000000..8236c4a4 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/IPharmacySettlementReportAppService.java @@ -0,0 +1,43 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.core.common.core.domain.R; + +/** + * 药房结算报表 appService + * + * @author GYY + * @date 2025-04-22 + */ +public interface IPharmacySettlementReportAppService { + + /** + * 查询药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @return 药房结算列表 + */ + R getListInfo(String startTime, String endTime, String searchKey, Long locationId); + + /** + * 导出药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @param request 请求 + * @param response 响应 + */ + void exportExcel(String startTime, String endTime, String searchKey, Long locationId, HttpServletRequest request, + HttpServletResponse response); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/AmbAdviceStatisticsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/AmbAdviceStatisticsAppServiceImpl.java new file mode 100644 index 00000000..6354e91f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/AmbAdviceStatisticsAppServiceImpl.java @@ -0,0 +1,119 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice.impl; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.core.common.core.domain.R; +import com.core.common.utils.poi.ExcelUtil; +import com.openhis.common.enums.EncounterClass; +import com.openhis.common.enums.RequestStatus; +import com.openhis.web.reportmanage.appservice.IAmbAdviceStatisticsAppService; +import com.openhis.web.reportmanage.dto.AmbActAdviceStatisticsDto; +import com.openhis.web.reportmanage.dto.AmbMedAdviceStatisticsDto; +import com.openhis.web.reportmanage.mapper.AmbAdviceStatisticsAppMapper; + +/** + * 门诊医嘱统计 impl + * + * @author GYY + * @date 2025-04-22 + */ +@Service +public class AmbAdviceStatisticsAppServiceImpl implements IAmbAdviceStatisticsAppService { + + @Autowired + private AmbAdviceStatisticsAppMapper ambAdviceStatisticsAppMapper; + + /** + * 查询门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊药品医嘱统计 + */ + @Override + public R getMedStatistics(String startTime, String endTime, String contractNo, String patientName, + Long openOrgId) { + List medStatistics = + ambAdviceStatisticsAppMapper.getMedStatistics(startTime, endTime, contractNo, patientName, openOrgId, + RequestStatus.COMPLETED.getValue(), EncounterClass.AMB.getValue()); + return R.ok(medStatistics); + } + + /** + * 导出 门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + @Override + public void exportMedExcel(String startTime, String endTime, String contractNo, String patientName, Long openOrgId, + HttpServletRequest request, HttpServletResponse response) { + Object data = this.getMedStatistics(startTime, endTime, contractNo, patientName, openOrgId).getData(); + List dataList = (List)data; + if (dataList != null && !dataList.isEmpty()) { + // 导出 + ExcelUtil util = new ExcelUtil<>(AmbMedAdviceStatisticsDto.class); + util.exportExcel(response, dataList, "门诊药品医嘱统计"); + } + } + + /** + * 查询门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊诊疗医嘱统计 + */ + @Override + public R getActStatistics(String startTime, String endTime, String contractNo, String patientName, + Long openOrgId) { + List actStatistics = + ambAdviceStatisticsAppMapper.getActStatistics(startTime, endTime, contractNo, patientName, openOrgId, + RequestStatus.COMPLETED.getValue(), EncounterClass.AMB.getValue()); + return R.ok(actStatistics); + } + + /** + * 导出 门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + @Override + public void exportActExcel(String startTime, String endTime, String contractNo, String patientName, Long openOrgId, + HttpServletRequest request, HttpServletResponse response) { + Object data = this.getActStatistics(startTime, endTime, contractNo, patientName, openOrgId).getData(); + List dataList = (List)data; + if (dataList != null && !dataList.isEmpty()) { + // 导出 + ExcelUtil util = new ExcelUtil<>(AmbActAdviceStatisticsDto.class); + util.exportExcel(response, dataList, "门诊诊疗医嘱统计"); + } + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/OutpatientManageReportAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/OutpatientManageReportAppServiceImpl.java new file mode 100644 index 00000000..62b03b9c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/OutpatientManageReportAppServiceImpl.java @@ -0,0 +1,127 @@ +package com.openhis.web.reportmanage.appservice.impl; + +import java.io.IOException; +import java.util.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.core.common.exception.NonCaptureException; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.NewExcelUtil; +import com.core.common.utils.StringUtils; +import com.core.common.utils.poi.ExcelUtil; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.web.document.util.EnumUtil; +import com.openhis.web.inventorymanage.dto.ProductDetailPageDto; +import com.openhis.web.reportmanage.dto.InboundReportPageDto; +import com.openhis.web.reportmanage.dto.InboundReportSearchParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.openhis.administration.dto.OutpatientManageDto; +import com.openhis.administration.service.IEncounterService; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.common.utils.PageUtils; +import com.openhis.web.reportmanage.appservice.IOutpatientManageReportAppService; +import com.openhis.web.reportmanage.dto.OutpatientManageParam; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * 门诊记录相关报表 应用实现类 + * + * @author swb + * @date 2026/2/27 + */ +@Service +public class OutpatientManageReportAppServiceImpl implements IOutpatientManageReportAppService { + @Autowired + IEncounterService encounterService; + + /** + * 门诊就诊记录初始化 + * + * @return 门诊就诊记录 + */ + @Override + public R init() { + List medicalRecord = + encounterService.getMedicalRecord(HisQueryUtils.buildQueryWrapper(null, null, null, null)); + Page page = PageUtils.buildPage(medicalRecord, 1, 10); + return R.ok(page); + } + + /** + * 查询门诊就诊记录 + * + * @param outpatientManageParam 查询参数 + * @param searchKey 模糊查询条件 + * @param pageNo 页码 + * @param pageSize 每页数量 + * @param request 请求 + * @return 门诊就诊记录 + */ + @Override + public R getOutpatientRecordPage(OutpatientManageParam outpatientManageParam, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request) { + QueryWrapper wrapper = HisQueryUtils.buildQueryWrapper(outpatientManageParam, searchKey, + new HashSet<>(Arrays.asList("encounterStatus","id_card", "patient_bus_no", "encounter_bus_no", "name")), request); + // 查询挂号记录 + List medicalRecords = encounterService.getMedicalRecord(wrapper); + Page page = PageUtils.buildPage(medicalRecords, pageNo, pageSize); + return R.ok(page); + } + + /** + * 就诊记录导出 + * + * @param outpatientManageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @param response 响应数据 + */ + @Override + public void ExportExcel(OutpatientManageParam outpatientManageParam, String searchKey, HttpServletRequest request, + HttpServletResponse response) { + // 构建查询条件 + QueryWrapper wrapper = HisQueryUtils.buildQueryWrapper(outpatientManageParam, searchKey, + new HashSet<>(Arrays.asList("encounterStatus","id_card", "patient_bus_no", "encounter_bus_no", "name")), request); + + // 查询门诊记录数据 + List medicalRecords = encounterService.getMedicalRecord(wrapper); + List receiptDetailList = medicalRecords; + + // 记录为空的情况下,直接通过响应返回提示 + if (receiptDetailList.isEmpty()) { + try { + // 设置响应为JSON格式,返回无数据提示 + response.setContentType("application/json;charset=utf-8"); + response.getWriter().write("{\"code\":500,\"msg\":\"导出Excel失败,无数据。\",\"data\":null}"); + return; + } catch (IOException e) { + e.printStackTrace(); + } + } + + try { + // 执行Excel导出(ExcelUtil需正确设置响应头为Excel格式) + String excelName = CommonConstants.SheetName.OUTPATIENT_MEDICAL_RECORD; + ExcelUtil util = new ExcelUtil<>(OutpatientManageDto.class); + util.exportExcel(response, receiptDetailList, excelName); + } catch (Exception e) { + e.printStackTrace(); + try { + // 异常时返回JSON格式的错误提示 + response.setContentType("application/json;charset=utf-8"); + response.getWriter().write("{\"code\":500,\"msg\":\"导出Excel失败:" + e.getMessage() + "\",\"data\":null}"); + } catch (IOException ioException) { + throw new NonCaptureException(StringUtils.format("导出excel失败"), e); + } + } + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/PharmacySettlementReportAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/PharmacySettlementReportAppServiceImpl.java new file mode 100644 index 00000000..5cfa85d4 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/PharmacySettlementReportAppServiceImpl.java @@ -0,0 +1,473 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.appservice.impl; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.core.common.core.domain.R; +import com.core.common.utils.poi.ExcelUtil; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.enums.ConditionCode; +import com.openhis.common.enums.DispenseStatus; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.reportmanage.appservice.IPharmacySettlementReportAppService; +import com.openhis.web.reportmanage.dto.PharmacySettlementMedDto; +import com.openhis.web.reportmanage.dto.PharmacySettlementReportDto; +import com.openhis.web.reportmanage.dto.UnitTransformationDto; +import com.openhis.web.reportmanage.mapper.PharmacySettlementReportAppMapper; + +/** + * 药房结算报表 impl + * + * @author GYY + * @date 2025-04-22 + */ +@Service +public class PharmacySettlementReportAppServiceImpl implements IPharmacySettlementReportAppService { + + @Autowired + private PharmacySettlementReportAppMapper pharmacySettlementReportAppMapper; + + /** + * 查询药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @return 药房结算列表 + */ + @Override + public R getListInfo(String startTime, String endTime, String searchKey, Long locationId) { + // 药品列表 + List listInfo = pharmacySettlementReportAppMapper.getListInfo(searchKey); + // 发药信息 (已按药品定义id分组) + List dispenseInfo = pharmacySettlementReportAppMapper.getDispenseInfo(startTime, + endTime, locationId, DispenseStatus.COMPLETED.getValue(), DispenseStatus.REFUNDED.getValue()); + // 创建映射(发药) + Map dispenseMap = dispenseInfo.stream() + .collect(Collectors.toMap(PharmacySettlementMedDto::getMedicationId, dto -> dto, + // 处理重复key的情况 - 可以选择第一个或最后一个,这里选择第一个 + (existing, replacement) -> existing)); + // 药房供应信息 + List supplyRequestInfo = pharmacySettlementReportAppMapper.getSupplyRequestInfo( + startTime, endTime, locationId, DispenseStatus.COMPLETED.getValue(), + CommonConstants.TableName.MED_MEDICATION_DEFINITION, SupplyType.PRODUCT_BATCH_STOCKTAKING.getValue(), + SupplyType.PRODUCT_STOCKTAKING.getValue(), SupplyType.PRODUCT_TRANSFER.getValue(), + SupplyType.PRODUCT_BATCH_TRANSFER.getValue(), SupplyType.LOSS_REPORT_FORM.getValue(), + SupplyType.ISSUE_INVENTORY.getValue(), SupplyType.RETURN_ISSUE.getValue()); + // 供应信息按药品id分组 + Map> medSupplyRequestMap = + supplyRequestInfo.stream().collect(Collectors.groupingBy(PharmacySettlementMedDto::getMedicationId)); + // 药品库存信息 + List inventoryInfo = pharmacySettlementReportAppMapper.getInventoryInfo(locationId, + CommonConstants.TableName.MED_MEDICATION_DEFINITION, ConditionCode.LOT_NUMBER_COST.getCode()); + // 库存信息按药品id分组 + Map> medInventoryMap = + inventoryInfo.stream().collect(Collectors.groupingBy(PharmacySettlementMedDto::getMedicationId)); + + for (PharmacySettlementReportDto li : listInfo) { + // 发药信息赋值 + PharmacySettlementMedDto dispenseDto = dispenseMap.get(li.getItemId()); + if (dispenseDto != null) { + this.handleDispense(li, dispenseDto); + } + // 供应信息赋值 + List medSupplyRequestList = medSupplyRequestMap.get(li.getItemId()); + if (medSupplyRequestList != null && !medSupplyRequestList.isEmpty()) { + // 调拨入 + List transferInList = medSupplyRequestList.stream() + .filter(e -> locationId.equals(e.getPurposeLocationId()) + && (SupplyType.PRODUCT_TRANSFER.getValue().equals(e.getTypeEnum()) + || SupplyType.PRODUCT_BATCH_TRANSFER.getValue().equals(e.getTypeEnum()))) + .collect(Collectors.toList()); + if (!transferInList.isEmpty()) { + this.handleTransferIn(li, transferInList); + } + // 调拨出 + List transferOutList = medSupplyRequestList.stream() + .filter(e -> locationId.equals(e.getSourceLocationId()) + && (SupplyType.PRODUCT_TRANSFER.getValue().equals(e.getTypeEnum()) + || SupplyType.PRODUCT_BATCH_TRANSFER.getValue().equals(e.getTypeEnum()))) + .collect(Collectors.toList()); + if (!transferOutList.isEmpty()) { + this.handleTransferOut(li, transferOutList); + } + // 盘点 + List stockTakeList = medSupplyRequestList.stream() + .filter(e -> SupplyType.PRODUCT_BATCH_STOCKTAKING.getValue().equals(e.getTypeEnum()) + || SupplyType.PRODUCT_STOCKTAKING.getValue().equals(e.getTypeEnum())) + .collect(Collectors.toList()); + if (!stockTakeList.isEmpty()) { + this.handleStockTake(li, stockTakeList); + } + // 报损 + List lossList = medSupplyRequestList.stream() + .filter(e -> SupplyType.LOSS_REPORT_FORM.getValue().equals(e.getTypeEnum())) + .collect(Collectors.toList()); + if (!lossList.isEmpty()) { + this.handleLoss(li, lossList); + } + // 领用 + List issueList = medSupplyRequestList.stream() + .filter(e -> SupplyType.ISSUE_INVENTORY.getValue().equals(e.getTypeEnum())) + .collect(Collectors.toList()); + if (!issueList.isEmpty()) { + this.handleIssue(li, issueList); + } + // 领用退 + List returnIssueList = medSupplyRequestList.stream() + .filter(e -> SupplyType.RETURN_ISSUE.getValue().equals(e.getTypeEnum())) + .collect(Collectors.toList()); + if (!returnIssueList.isEmpty()) { + this.handleReturnIssue(li, returnIssueList); + } + + } + // 库存信息赋值 + List medInventoryList = medInventoryMap.get(li.getItemId()); + if (medInventoryList != null && !medInventoryList.isEmpty()) { + this.handleInventory(li, medInventoryList); + } + + } + + return R.ok(listInfo); + } + + /** + * 导出药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @param request 请求 + * @param response 响应 + */ + @Override + public void exportExcel(String startTime, String endTime, String searchKey, Long locationId, + HttpServletRequest request, HttpServletResponse response) { + // 查询药房结算列表 + Object data = this.getListInfo(startTime, endTime, searchKey, locationId).getData(); + List dataList = (List)data; + if (dataList != null && !dataList.isEmpty()) { + // 导出 + ExcelUtil util = new ExcelUtil<>(PharmacySettlementReportDto.class); + util.exportExcel(response, dataList, "药房结算列表"); + } + } + + /** + * 处理库存信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param medInventoryList 库存信息 + */ + private void handleInventory(PharmacySettlementReportDto pharmacySettlementReportDto, + List medInventoryList) { + // 库存数量(小单位) + BigDecimal inventoryQuantity = medInventoryList.stream().map(PharmacySettlementMedDto::getInventoryQuantity) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 库存数量(小单位) + pharmacySettlementReportDto.setInventoryQuantity(inventoryQuantity); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getInventoryQuantity()); + // 库存数量(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setInventoryStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + // 库存金额 + BigDecimal inventoryPrice = BigDecimal.ZERO; + for (PharmacySettlementMedDto psmd : medInventoryList) { + // 库存数量 + BigDecimal quantity = psmd.getInventoryQuantity(); + // 批次号 + String lotNumber = psmd.getLotNumber(); + // 药品进价(包装单位) + BigDecimal amount = psmd.getAmount(); + // 药品进价(小单位) + BigDecimal minAmount = amount.divide(pharmacySettlementReportDto.getPartPercent(), 6, RoundingMode.HALF_UP); + // 小单位转换包装单位 + UnitTransformationDto utf = this.handleUnitTransformation(pharmacySettlementReportDto.getPartPercent(), + pharmacySettlementReportDto.getUnitCode(), pharmacySettlementReportDto.getUnitCodeText(), + pharmacySettlementReportDto.getMinUnitCode(), pharmacySettlementReportDto.getMinUnitCodeText(), + quantity); + // 商 | 整数部分,包装单位 + BigDecimal quotientQuantity = utf.getQuotientQuantity(); + // 余数 | 余数部分,小单位 + BigDecimal remainderQuantity = utf.getRemainderQuantity(); + // 计算本次循环的金额: amount * quotientQuantity + minAmount * remainderQuantity + BigDecimal currentAmount = BigDecimal.ZERO; + + // 处理商的部分 + if (quotientQuantity != null && quotientQuantity.compareTo(BigDecimal.ZERO) != 0) { + currentAmount = currentAmount.add(amount.multiply(quotientQuantity)); + } + // 处理余数的部分 + if (remainderQuantity != null && remainderQuantity.compareTo(BigDecimal.ZERO) != 0) { + currentAmount = currentAmount.add(minAmount.multiply(remainderQuantity)); + } + // 累加到总库存金额 + inventoryPrice = inventoryPrice.add(currentAmount); + } + // 库存金额 + pharmacySettlementReportDto.setInventoryPrice(inventoryPrice); + + } + + /** + * 处理领用退信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param returnIssueList 领用退信息 + */ + private void handleReturnIssue(PharmacySettlementReportDto pharmacySettlementReportDto, + List returnIssueList) { + // 小单位数 + BigDecimal minReturnIssueQuantity = + returnIssueList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal returnIssuePrice = returnIssueList.stream().map(PharmacySettlementMedDto::getTotalPrice) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 领用退数(小单位) + pharmacySettlementReportDto.setMinReturnIssueQuantity(minReturnIssueQuantity); + // 领用退金额 + pharmacySettlementReportDto.setReturnIssuePrice(returnIssuePrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinReturnIssueQuantity()); + // 领用退数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setReturnIssueStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + } + + /** + * 处理领用信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param issueList 领用信息 + */ + private void handleIssue(PharmacySettlementReportDto pharmacySettlementReportDto, + List issueList) { + // 小单位数 + BigDecimal minIssueQuantity = issueList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal issuePrice = issueList.stream().map(PharmacySettlementMedDto::getTotalPrice).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 领用数(小单位) + pharmacySettlementReportDto.setMinIssueQuantity(minIssueQuantity); + // 领用金额 + pharmacySettlementReportDto.setIssuePrice(issuePrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinIssueQuantity()); + // 领用数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setIssueStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + } + + /** + * 处理报损信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param lossList 报损信息 + */ + private void handleLoss(PharmacySettlementReportDto pharmacySettlementReportDto, + List lossList) { + // 小单位数 + BigDecimal minLossQuantity = lossList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal lossPrice = lossList.stream().map(PharmacySettlementMedDto::getTotalPrice).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 报损数(小单位) + pharmacySettlementReportDto.setMinLossQuantity(minLossQuantity); + // 报损金额 + pharmacySettlementReportDto.setLossPrice(lossPrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinLossQuantity()); + // 报损数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setLossStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + } + + /** + * 处理盘点信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param stockTakeList 盘点信息 + */ + private void handleStockTake(PharmacySettlementReportDto pharmacySettlementReportDto, + List stockTakeList) { + // 小单位数 + BigDecimal minStockTakeQuantity = stockTakeList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal stockTakePrice = stockTakeList.stream().map(PharmacySettlementMedDto::getProfitLossPrice) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 盘点数(小单位) + pharmacySettlementReportDto.setMinStockTakeQuantity(minStockTakeQuantity); + // 盘点盈亏金额 + pharmacySettlementReportDto.setStockTakePrice(stockTakePrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinStockTakeQuantity()); + // 盘点数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setStockTakeStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + + } + + /** + * 处理调拨出信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param transferOutList 调拨出信息 + */ + private void handleTransferOut(PharmacySettlementReportDto pharmacySettlementReportDto, + List transferOutList) { + // 小单位数 + BigDecimal minTransferOutQuantity = + transferOutList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal transferOutPrice = transferOutList.stream().map(PharmacySettlementMedDto::getTotalPrice) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 调拨出数(小单位) + pharmacySettlementReportDto.setMinTransferOutQuantity(minTransferOutQuantity); + // 调拨出金额 + pharmacySettlementReportDto.setTransferOutPrice(transferOutPrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinTransferOutQuantity()); + // 调拨出数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setTransferOutStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + } + + /** + * 处理调拨入信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param transferInList 调拨入信息 + */ + private void handleTransferIn(PharmacySettlementReportDto pharmacySettlementReportDto, + List transferInList) { + // 小单位数 + BigDecimal minTransferInQuantity = + transferInList.stream().map(PharmacySettlementMedDto::getSupplyRequestQuantity).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 总金额 + BigDecimal transferInPrice = transferInList.stream().map(PharmacySettlementMedDto::getTotalPrice) + .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + // 调拨入数(小单位) + pharmacySettlementReportDto.setMinTransferInQuantity(minTransferInQuantity); + // 调拨入金额 + pharmacySettlementReportDto.setTransferInPrice(transferInPrice); + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinTransferInQuantity()); + // 调拨入数(整体单位,即XXX盒XXX粒) + pharmacySettlementReportDto.setTransferInStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); + } + + /** + * 处理发药信息 + * + * @param pharmacySettlementReportDto 药品基础信息 + * @param pharmacySettlementMedDto 药品发药信息 + */ + private void handleDispense(PharmacySettlementReportDto pharmacySettlementReportDto, + PharmacySettlementMedDto pharmacySettlementMedDto) { + pharmacySettlementReportDto.setMinDispenseQuantity(pharmacySettlementMedDto.getActualQuantity()); // 实际发药数(小单位) + pharmacySettlementReportDto.setDispensePrice(pharmacySettlementMedDto.getDispensePrice()); // 发放金额 + // 小单位转换包装单位 + UnitTransformationDto unitTransformationDto = this.handleUnitTransformation( + pharmacySettlementReportDto.getPartPercent(), pharmacySettlementReportDto.getUnitCode(), + pharmacySettlementReportDto.getUnitCodeText(), pharmacySettlementReportDto.getMinUnitCode(), + pharmacySettlementReportDto.getMinUnitCodeText(), pharmacySettlementReportDto.getMinDispenseQuantity()); + pharmacySettlementReportDto.setDispenseStrQuantity( + unitTransformationDto.getStrQuantity() != null ? unitTransformationDto.getStrQuantity() : ""); // 发药数(整体单位,即XXX盒XXX粒) + } + + /** + * 小单位转换包装单位 + * + * @param partPercent 拆零比 + * @param unitCode 包装单位编码 + * @param unitCodeText 包装单位 + * @param minUnitCode 小单位编码 + * @param minUnitCodeText 小单位 + * @param minUnitQuantity 小单位数量 + * @return 小单位转换包装单位 + */ + private UnitTransformationDto handleUnitTransformation(BigDecimal partPercent, String unitCode, String unitCodeText, + String minUnitCode, String minUnitCodeText, BigDecimal minUnitQuantity) { + + UnitTransformationDto unitTransformationDto = new UnitTransformationDto(); + unitTransformationDto.setPartPercent(partPercent); // 拆零比 + + // 处理负数情况:取绝对值 + if (minUnitQuantity != null && minUnitQuantity.compareTo(BigDecimal.ZERO) < 0) { + minUnitQuantity = minUnitQuantity.abs(); + } + + // 只有当小单位数量非空且大于0时才进行计算 + if (minUnitQuantity != null && minUnitQuantity.compareTo(BigDecimal.ZERO) > 0) { + // 计算商(包装单位数量)和余数(小单位数量) + BigDecimal[] divideResult = minUnitQuantity.divideAndRemainder(partPercent); + BigDecimal quotient = divideResult[0]; // 商 + BigDecimal remainder = divideResult[1]; // 余数 + + unitTransformationDto.setMinUnitQuantity(minUnitQuantity); // 小单位数量 + unitTransformationDto.setQuotientQuantity(quotient); // 商 + unitTransformationDto.setRemainderQuantity(remainder); // 余数 + + // 构建拼接字符串 + StringBuilder strQuantityBuilder = new StringBuilder(); + if (quotient.compareTo(BigDecimal.ZERO) > 0) { + strQuantityBuilder.append(quotient.stripTrailingZeros().toPlainString()).append(unitCodeText); + } + if (remainder.compareTo(BigDecimal.ZERO) > 0) { + strQuantityBuilder.append(remainder.stripTrailingZeros().toPlainString()).append(minUnitCodeText); + } + // 如果商为0,只显示余数 + unitTransformationDto.setStrQuantity(strQuantityBuilder.toString()); + } + + return unitTransformationDto; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/AmbAdviceStatisticsAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/AmbAdviceStatisticsAppController.java new file mode 100644 index 00000000..5a31e953 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/AmbAdviceStatisticsAppController.java @@ -0,0 +1,112 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IAmbAdviceStatisticsAppService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 门诊医嘱统计 controller + * + * @author GYY + * @date 2025-04-22 + */ +@RestController +@RequestMapping("/report-manage/amb-advice") +@Slf4j +public class AmbAdviceStatisticsAppController { + + @Autowired + private IAmbAdviceStatisticsAppService ambAdviceStatisticsAppService; + + /** + * 查询门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊药品医嘱统计 + */ + @GetMapping(value = "/med-statistics") + public R getMedStatistics(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "contractNo", required = false) String contractNo, + @RequestParam(name = "patientName", required = false) String patientName, + @RequestParam(name = "openOrgId", required = false) Long openOrgId) { + return ambAdviceStatisticsAppService.getMedStatistics(startTime, endTime, contractNo, patientName, openOrgId); + } + + /** + * 导出 门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + @GetMapping(value = "/export-med-excel") + public void exportMedExcel(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "contractNo", required = false) String contractNo, + @RequestParam(name = "patientName", required = false) String patientName, + @RequestParam(name = "openOrgId", required = false) Long openOrgId, HttpServletRequest request, + HttpServletResponse response) { + ambAdviceStatisticsAppService.exportMedExcel(startTime, endTime, contractNo, patientName, openOrgId, request, + response); + } + + /** + * 查询门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @return 门诊诊疗医嘱统计 + */ + @GetMapping(value = "/act-statistics") + public R getActStatistics(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "contractNo", required = false) String contractNo, + @RequestParam(name = "patientName", required = false) String patientName, + @RequestParam(name = "openOrgId", required = false) Long openOrgId) { + return ambAdviceStatisticsAppService.getActStatistics(startTime, endTime, contractNo, patientName, openOrgId); + } + + /** + * 导出 门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param request 请求 + * @param response 响应 + */ + @GetMapping(value = "/export-act-excel") + public void exportActExcel(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "contractNo", required = false) String contractNo, + @RequestParam(name = "patientName", required = false) String patientName, + @RequestParam(name = "openOrgId", required = false) Long openOrgId, HttpServletRequest request, + HttpServletResponse response) { + ambAdviceStatisticsAppService.exportActExcel(startTime, endTime, contractNo, patientName, openOrgId, request, + response); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/OutpatientManageReportController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/OutpatientManageReportController.java new file mode 100644 index 00000000..31983f52 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/OutpatientManageReportController.java @@ -0,0 +1,93 @@ +package com.openhis.web.reportmanage.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.openhis.common.enums.EncounterStatus; +import com.openhis.web.document.util.EnumUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IOutpatientManageReportAppService; +import com.openhis.web.reportmanage.dto.OutpatientManageParam; + +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +/** + * 门诊记录相关报表 controller + * + * @author swb + * @date 2026/2/27 + */ +@RestController +@RequestMapping("/patient-manage/records") +@Slf4j +public class OutpatientManageReportController { + + @Autowired + IOutpatientManageReportAppService outpatientManageReportAppService; + + /** + * 门诊就诊记录初始化 + * + * @return 门诊就诊记录 + */ + @GetMapping(value = "/init") + public R init() { + return outpatientManageReportAppService.init(); + } + + /** + * 获取就诊状态枚举 + * + * @return 就诊状态 + */ + + @GetMapping("/encounterStatusInit") + public R encounterStatusInit() { + Map map = new HashMap<>(); + // 获取就诊状态枚举列表 + map.put("encounterStatus", EnumUtil.toMapList(EncounterStatus.class)); + return R.ok(map); + } + /** + * 查询门诊就诊记录 + * + * @param outpatientManageParam 查询参数 + * @param searchKey 模糊查询条件 + * @param pageNo 页码 + * @param pageSize 每页数量 + * @param request 请求 + * @return 门诊就诊记录 + */ + @GetMapping(value = "/outpatient-record-page") + public R getOutpatientRecordPage(OutpatientManageParam outpatientManageParam, + @RequestParam(value = "searchKey", required = false) String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return outpatientManageReportAppService.getOutpatientRecordPage(outpatientManageParam, searchKey, pageNo, + pageSize, request); + } + + /** + * 就诊记录导出 + * + * @param outpatientManageParam 搜索条件 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @param response 响应数据 + */ + @GetMapping(value = "/export-excel") + public void ExportExcel(OutpatientManageParam outpatientManageParam, + @RequestParam(value = "searchKey", required = false) String searchKey, + HttpServletRequest request, HttpServletResponse response){ + outpatientManageReportAppService.ExportExcel(outpatientManageParam, searchKey, request, response); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/PharmacySettlementReportAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/PharmacySettlementReportAppController.java new file mode 100644 index 00000000..ccf22136 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/controller/PharmacySettlementReportAppController.java @@ -0,0 +1,67 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.core.common.core.domain.R; +import com.openhis.web.reportmanage.appservice.IPharmacySettlementReportAppService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 药房结算报表 controller + * + * @author GYY + * @date 2025-04-22 + */ +@RestController +@RequestMapping("/report-manage/pharmacy-settlement") +@Slf4j +public class PharmacySettlementReportAppController { + + @Autowired + private IPharmacySettlementReportAppService pharmacySettlementReportAppService; + + /** + * 查询药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @return 药房结算列表 + */ + @GetMapping(value = "/list-info") + public R getListInfo(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "searchKey", required = false) String searchKey, + @RequestParam(value = "locationId") Long locationId) { + return pharmacySettlementReportAppService.getListInfo(startTime, endTime, searchKey, locationId); + } + + /** + * 导出药房结算列表 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param searchKey 模糊查询关键字 + * @param locationId 药房id + * @param request 请求 + * @param response 响应 + */ + @GetMapping(value = "/export-excel") + public void exportExcel(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, + @RequestParam(name = "searchKey", required = false) String searchKey, + @RequestParam(value = "locationId") Long locationId, HttpServletRequest request, HttpServletResponse response) { + pharmacySettlementReportAppService.exportExcel(startTime, endTime, searchKey, locationId, request, response); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbActAdviceStatisticsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbActAdviceStatisticsDto.java new file mode 100644 index 00000000..0d6d912d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbActAdviceStatisticsDto.java @@ -0,0 +1,99 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; +import java.util.Date; + +import com.core.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊诊疗医嘱统计 dto + * + * @author GYY + * @date 2025-04-22 + */ +@Data +@Accessors(chain = true) +public class AmbActAdviceStatisticsDto { + + /** + * 医嘱开立时间 + */ + @Excel(name = "医嘱开立时间", sort = 1, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date reqAuthoredTime; + + /** + * 患者名称 + */ + @Excel(name = "患者名称", sort = 2) + private String patientName; + + /** + * 费用性质编码 + */ + private String contractNo; + + /** + * 费用性质 + */ + @Excel(name = "费用性质", sort = 3) + private String contractName; + + /** + * 诊断名称 + */ + @Excel(name = "诊断名称", sort = 4) + private String conditionName; + + /** + * 诊断医保码 + */ + @Excel(name = "诊断医保码", sort = 5) + private String conditionYbNo; + + /** + * 医嘱名称 + */ + @Excel(name = "医嘱名称", sort = 6) + private String adviceName; + + /** + * 数量 + */ + @Excel(name = "数量", sort = 7, scale = 0) + private BigDecimal quantity; + + /** + * 金额 + */ + @Excel(name = "金额", sort = 8, scale = 2) + private BigDecimal totalPrice; + + /** + * 开立医生 + */ + @Excel(name = "开立医生", sort = 9) + private String doctorName; + + /** + * 开立科室id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long openOrgId; + + /** + * 开立科室 + */ + @Excel(name = "开立科室", sort = 10) + private String openOrgName; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbMedAdviceStatisticsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbMedAdviceStatisticsDto.java new file mode 100644 index 00000000..a72af7e0 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmbMedAdviceStatisticsDto.java @@ -0,0 +1,111 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; +import java.util.Date; + +import com.core.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊药品医嘱统计 dto + * + * @author GYY + * @date 2025-04-22 + */ +@Data +@Accessors(chain = true) +public class AmbMedAdviceStatisticsDto { + + /** + * 处方号 + */ + @Excel(name = "处方号", sort = 1) + private String prescriptionNo; + + /** + * 医嘱开立时间 + */ + @Excel(name = "医嘱开立时间", sort = 2, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date reqAuthoredTime; + + /** + * 患者名称 + */ + @Excel(name = "患者名称", sort = 3) + private String patientName; + + /** + * 费用性质编码 + */ + private String contractNo; + + /** + * 费用性质 + */ + @Excel(name = "费用性质", sort = 4) + private String contractName; + + /** + * 诊断名称 + */ + @Excel(name = "诊断名称", sort = 5) + private String conditionName; + + /** + * 诊断医保码 + */ + @Excel(name = "诊断医保码", sort = 6) + private String conditionYbNo; + + /** + * 医嘱名称 + */ + @Excel(name = "医嘱名称", sort = 7) + private String adviceName; + + /** + * 数量 + */ + @Excel(name = "数量", sort = 8, scale = 0) + private BigDecimal quantity; + + /** + * 单位 + */ + @Excel(name = "单位", sort = 9) + private String unitCodeText; + + /** + * 金额 + */ + @Excel(name = "金额", sort = 10, scale = 2) + private BigDecimal totalPrice; + + /** + * 开立医生 + */ + @Excel(name = "开立医生", sort = 11) + private String doctorName; + + /** + * 开立科室id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long openOrgId; + + /** + * 开立科室 + */ + @Excel(name = "开立科室", sort = 12) + private String openOrgName; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmountNumberDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmountNumberDto.java index 49a364c4..aab341ce 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmountNumberDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AmountNumberDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 金额数量 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java index 37f3edf5..87f1ccaf 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/AnnualReportStatisticsPageDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 报表统计 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/BottleLabelDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/BottleLabelDto.java index ebfe8132..db19157f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/BottleLabelDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/BottleLabelDto.java @@ -1,13 +1,14 @@ package com.openhis.web.reportmanage.dto; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.openhis.common.annotation.Dict; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; + /** * 护士输液的瓶签实体类 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportDto.java index 5549ee22..48521166 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportDto.java @@ -1,13 +1,14 @@ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.core.common.annotation.Excel; + import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.util.List; - /** * 费用明细报表导出专用DTO * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportInitDto.java index deb0f945..cc497f86 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportInitDto.java @@ -4,9 +4,11 @@ package com.openhis.web.reportmanage.dto; import com.openhis.administration.domain.Practitioner; +import com.openhis.web.doctorstation.dto.ElepPrescriptionInitDto; import lombok.Data; import lombok.experimental.Accessors; +import java.math.BigDecimal; import java.util.List; /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportPageDto.java index 968d06e9..07970a1e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportPageDto.java @@ -3,16 +3,17 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.core.common.annotation.Excel; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 费用明细报表 dto * @@ -133,7 +134,7 @@ public class ChargeReportPageDto { * 收费时间 */ @Excel(name = "收费时间", sort = 24, dateFormat = "yyyy-MM-dd HH:mm:ss") - private String chargeTime; + private Date chargeTime; /** * 规格 @@ -152,4 +153,7 @@ public class ChargeReportPageDto { */ @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; + + @Excel(name = "折后金额", sort = 25, scale = 4) + private BigDecimal systemDiscountPrice; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportSearchParam.java index e6c76ff1..9e95d224 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ChargeReportSearchParam.java @@ -3,6 +3,7 @@ */ package com.openhis.web.reportmanage.dto; +import com.baomidou.mybatisplus.annotation.TableField; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java index ab03348a..5f70e7fe 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DailyReportStatisticsPageDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 报表统计 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java index bf835f66..0a61f1a4 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DepartmentRevenueStatisticsPageDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; -import com.openhis.common.annotation.Dict; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; + /** * 科室收入统计 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementPageDto.java index 1172e345..76593486 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementPageDto.java @@ -3,13 +3,18 @@ */ package com.openhis.web.reportmanage.dto; -import com.openhis.common.annotation.Dict; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; + /** * 药品用量结算 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementSearchParam.java index ba56c949..0e5991ad 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/DrugDosageSettlementSearchParam.java @@ -3,6 +3,8 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportInitDto.java index 56e04f1c..6d7faa38 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportInitDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 入库明细报表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportPageDto.java index 87a004ba..8ef3af9c 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportPageDto.java @@ -3,17 +3,20 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.core.common.annotation.Excel; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 入库明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportSearchParam.java index 166e6ea4..fccb9b39 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InboundReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 入库明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageCollectionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageCollectionDto.java index 00764e48..c8fdd0f4 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageCollectionDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageCollectionDto.java @@ -1,11 +1,10 @@ package com.openhis.web.reportmanage.dto; -import lombok.Getter; -import lombok.Setter; - -import java.math.BigDecimal; import java.util.Date; +import lombok.Data; +import lombok.experimental.Accessors; +import java.math.BigDecimal; /** * 住院病案首页采集信息 @@ -13,8 +12,8 @@ import java.util.Date; * @author yuxj * @date 2025/8/25 */ -@Getter -@Setter +@Data +@Accessors(chain = true) public class InpatientMedicalRecordHomePageCollectionDto { // 组织机构代码 字符 30 必填 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageMakeDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageMakeDto.java index 40eb807f..2a8f6bcd 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageMakeDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InpatientMedicalRecordHomePageMakeDto.java @@ -1,12 +1,12 @@ package com.openhis.web.reportmanage.dto; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; import java.util.List; +import lombok.Data; +import lombok.experimental.Accessors; + /** * 住院病案首页采集信息搜索 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportPageDto.java index fee51cff..db6073fb 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportPageDto.java @@ -3,17 +3,18 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 库存商品明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportSearchParam.java index d920f426..0e541cd7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/InventoryProductReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 库存商品明细查询条件 * @@ -38,10 +38,4 @@ public class InventoryProductReportSearchParam { /** 供应商 */ private Long supplierId; - - /** 厂家/产地(供应商名称) */ - private String manufacturerText; - - /** 仓库ID(药房ID) */ - private Long purposeLocationId; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportPageDto.java index 276baf81..40a1ab82 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportPageDto.java @@ -3,17 +3,18 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.core.common.annotation.Excel; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 报损明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportSearchParam.java index dabb3e3a..53843b61 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/LossReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 报损明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedDevUseReportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedDevUseReportDto.java index dd9d6ea6..61ae4cca 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedDevUseReportDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedDevUseReportDto.java @@ -3,13 +3,15 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 药品、耗材月结(筛选统计时间区间内的) dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedUseReportInfoDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedUseReportInfoDto.java index ddd80870..8fd4a912 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedUseReportInfoDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedUseReportInfoDto.java @@ -3,16 +3,18 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; -import java.math.BigDecimal; -import java.util.Date; - /** * 统计科室药品开立情况 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedicationUsageParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedicationUsageParam.java new file mode 100644 index 00000000..c69c7847 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MedicationUsageParam.java @@ -0,0 +1,31 @@ +package com.openhis.web.reportmanage.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 药品使用情况查询参数 + * + * @author swb + * @date 2026/2/10 + */ +@Data +@Accessors(chain = true) +public class MedicationUsageParam { + /** + * 药品目录 + */ + private List categoryCodes; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementDto.java index f6ead9f1..8a1e2b67 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementDto.java @@ -3,14 +3,15 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 月末结算报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementInitDto.java index efd5e822..473ef3ab 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/MonthlySettlementInitDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 月末结算报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportInitDto.java index f970d469..52d46772 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportInitDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 出库明细报表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportPageDto.java index 3078c6e5..dcf10435 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportPageDto.java @@ -1,5 +1,7 @@ package com.openhis.web.reportmanage.dto; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.core.common.annotation.Excel; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportSearchParam.java index 86062f9e..3b1928ea 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutboundReportSearchParam.java @@ -1,5 +1,8 @@ package com.openhis.web.reportmanage.dto; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientBillingDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientBillingDto.java new file mode 100644 index 00000000..d97fc5ce --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientBillingDto.java @@ -0,0 +1,166 @@ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊收费结算报表Dto + * + * @author swb + * @date 2026/1/4 + */ +@Data +@Accessors(chain = true) +public class OutpatientBillingDto { + /** + * 放射费 + */ + private BigDecimal radiology; + + /** + * 其他费用 + */ + private BigDecimal otherFees; + + /** + * 诊查费 + */ + private BigDecimal consultationFee; + + /** + * 材料费 + */ + private BigDecimal medicalConsumables; + + /** + * 治疗费 + */ + private BigDecimal treatment; + + /** + * 床位费 + */ + private BigDecimal bed; + + /** + * 中成药费用 + */ + private BigDecimal chinesePatentMedicine; + + /** + * 西药费用 + */ + private BigDecimal westernMedicine; + + /** + * 化验费 + */ + private BigDecimal labTest; + + /** + * 检查费 + */ + private BigDecimal inspection; + + /** + * 电诊费 + */ + private BigDecimal electroDiagnosis; + + /** + * 中草药费用 + */ + private BigDecimal chineseHerbs; + + /** + * 项目 + */ + private String project; + + /** + * 挂号数 + */ + private Integer registrationCount; + + /** + * 退号数 + */ + private Integer refundCount; + + /** + * 有效号 + */ + private Integer validCount; + + /** + * 挂号费 + */ + private BigDecimal registrationFee; + + /** + * 退号 + */ + private String refundBusNo; + + /** + * 合计 + */ + private BigDecimal total; + + /** + * 发票张数 + */ + private Integer totalCount; + + /** + * 开始发票号 + */ + private String startInvoiceNo; + + /** + * 结束发票号 + */ + private String endInvoiceNo; + + /** + * 退费发票号 + */ + private String refundInvoiceNo; + + /** + * 退费合计 + */ + private BigDecimal refundFee; + + /** + * 账户金额 + */ + private BigDecimal balance; + + /** + * 现金 + */ + private BigDecimal cash; + + /** + * 统筹金额 + */ + private BigDecimal pooled; + + /** + * 学校垫金 + */ + private BigDecimal school; + + /** + * 舍入金额 + */ + private BigDecimal rounded; + + /** + * 应收金额 + */ + private BigDecimal receivable; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientManageParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientManageParam.java new file mode 100644 index 00000000..80af9c30 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientManageParam.java @@ -0,0 +1,33 @@ +package com.openhis.web.reportmanage.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊就诊记录查询参数 + * + * @author swb + * @date 2026/2/27 + */ +@Data +@Accessors(chain = true) +public class OutpatientManageParam { + /** + * 电话 + */ + private String phone; + + /** + * 医生 + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long doctorId; + + /** + * 就诊状态 + */ + private Integer subjectStatusEnum; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientSettlementDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientSettlementDto.java index df82bf9b..8dba0f07 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientSettlementDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/OutpatientSettlementDto.java @@ -1,5 +1,6 @@ package com.openhis.web.reportmanage.dto; +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementMedDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementMedDto.java new file mode 100644 index 00000000..a2e50b80 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementMedDto.java @@ -0,0 +1,90 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 药房结算报表 药品 dto + * + * @author GYY + * @date 2025-04-22 + */ +@Data +@Accessors(chain = true) +public class PharmacySettlementMedDto { + + /** + * 药品定义id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long medicationId; + + /** + * 小单位编码 + */ + private String minUnitCode; + + /** + * 实际发药数(小单位) + */ + private BigDecimal actualQuantity; + + /** + * 发放金额 + */ + private BigDecimal dispensePrice; + + /** 供应类型 */ + private Integer typeEnum; + + /** + * 源仓库id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long sourceLocationId; + + /** + * 目的仓库id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long purposeLocationId; + + /** + * 调拨/盘点数(小单位) + */ + private BigDecimal supplyRequestQuantity; + + /** + * 总金额 + */ + private BigDecimal totalPrice; + + /** + * 盘点盈亏金额 + */ + private BigDecimal profitLossPrice; + + /** + * 库存数量(小单位) + */ + private BigDecimal inventoryQuantity; + + /** + * 批次号 + */ + private String lotNumber; + + /** + * 药品进价(包装单位) + */ + private BigDecimal amount; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementReportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementReportDto.java new file mode 100644 index 00000000..273f768d --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PharmacySettlementReportDto.java @@ -0,0 +1,243 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import com.core.common.annotation.Excel; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 药房结算报表 dto + * + * @author GYY + * @date 2025-04-22 + */ +@Data +@Accessors(chain = true) +public class PharmacySettlementReportDto { + + /** + * 药品分类 + */ + @Excel(name = "药品分类", sort = 1) + private String categoryCodeText; + + /** + * 药品编码 + */ + @Excel(name = "药品编码", sort = 2) + private String itemNo; + + /** + * 项目id + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long itemId; + + /** + * 项目名称 + */ + @Excel(name = "名称", sort = 3) + private String itemName; + + /** + * 规格 + */ + @Excel(name = "规格", sort = 4) + private String totalVolume; + + /** + * 包装单位编码 + */ + private String unitCode; + + /** + * 包装单位 + */ + @Excel(name = "包装单位", sort = 5) + private String unitCodeText; + + /** + * 小单位编码 + */ + private String minUnitCode; + + /** + * 小单位 + */ + @Excel(name = "小单位", sort = 6) + private String minUnitCodeText; + + /** + * 拆零比 + */ + @Excel(name = "拆零比", sort = 7, scale = 0) + private BigDecimal partPercent; + + // -------------------------------------发药----------------------------------------- + + /** + * 发药数(小单位) + */ + @Excel(name = "发药数(小单位)", sort = 8, scale = 0) + private BigDecimal minDispenseQuantity; + + /** + * 发药数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "发药数", sort = 9) + private String dispenseStrQuantity; + + /** + * 发放金额 + */ + @Excel(name = "发放金额", sort = 10, scale = 2) + private BigDecimal dispensePrice; + + // -------------------------------------调拨入----------------------------------------- + /** + * 调拨入数(小单位) + */ + @Excel(name = "调拨入数(小单位)", sort = 11, scale = 0) + private BigDecimal minTransferInQuantity; + + /** + * 调拨入数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "调拨入数", sort = 12) + private String transferInStrQuantity; + + /** + * 调拨入金额 + */ + @Excel(name = "调拨入金额", sort = 13, scale = 2) + private BigDecimal transferInPrice; + + // -------------------------------------调拨出----------------------------------------- + /** + * 调拨出数(小单位) + */ + @Excel(name = "调拨出数(小单位)", sort = 14, scale = 0) + private BigDecimal minTransferOutQuantity; + + /** + * 调拨出数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "调拨出数", sort = 15) + private String transferOutStrQuantity; + + /** + * 调拨出金额 + */ + @Excel(name = "调拨出金额", sort = 16, scale = 2) + private BigDecimal transferOutPrice; + // -------------------------------------盘点----------------------------------------- + /** + * 盘点数(小单位) + */ + @Excel(name = "盘点数(小单位)", sort = 17, scale = 0) + private BigDecimal minStockTakeQuantity; + + /** + * 盘点数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "盘点数", sort = 18) + private String stockTakeStrQuantity; + + /** + * 盘点盈亏金额 + */ + @Excel(name = "盘点盈亏金额", sort = 19, scale = 2) + private BigDecimal stockTakePrice; + // -------------------------------------报损----------------------------------------- + /** + * 报损数(小单位) + */ + @Excel(name = "报损数(小单位)", sort = 20, scale = 0) + private BigDecimal minLossQuantity; + + /** + * 报损数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "报损数", sort = 21) + private String lossStrQuantity; + + /** + * 报损金额 + */ + @Excel(name = "报损金额", sort = 22, scale = 2) + private BigDecimal lossPrice; + // -------------------------------------领用----------------------------------------- + /** + * 领用数(小单位) + */ + @Excel(name = "领用数(小单位)", sort = 23, scale = 0) + private BigDecimal minIssueQuantity; + + /** + * 领用数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "领用数", sort = 24) + private String issueStrQuantity; + + /** + * 领用金额 + */ + @Excel(name = "领用金额", sort = 25, scale = 2) + private BigDecimal issuePrice; + // -------------------------------------领用退----------------------------------------- + /** + * 领用退数(小单位) + */ + @Excel(name = "领用退数(小单位)", sort = 26, scale = 0) + private BigDecimal minReturnIssueQuantity; + + /** + * 领用退数(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "领用退数", sort = 27) + private String returnIssueStrQuantity; + + /** + * 领用退金额 + */ + @Excel(name = "领用退金额", sort = 28, scale = 2) + private BigDecimal returnIssuePrice; + + // -------------------------------------当前库存----------------------------------------- + /** + * 库存数量(小单位) + */ + @Excel(name = "库存数量(小单位)", sort = 29, scale = 0) + private BigDecimal inventoryQuantity; + + /** + * 库存数量(整体单位,即XXX盒XXX粒) + */ + @Excel(name = "库存数量", sort = 30) + private String inventoryStrQuantity; + + /** + * 库存金额 + */ + @Excel(name = "库存金额", sort = 31, scale = 2) + private BigDecimal inventoryPrice; + + public PharmacySettlementReportDto() { + this.minDispenseQuantity = BigDecimal.ZERO; + this.minTransferInQuantity = BigDecimal.ZERO; + this.minTransferOutQuantity = BigDecimal.ZERO; + this.minStockTakeQuantity = BigDecimal.ZERO; + this.minLossQuantity = BigDecimal.ZERO; + this.minIssueQuantity = BigDecimal.ZERO; + this.minReturnIssueQuantity = BigDecimal.ZERO; + this.inventoryQuantity = BigDecimal.ZERO; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PrescriptionPrintDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PrescriptionPrintDto.java index a29ac588..de2584e5 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PrescriptionPrintDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PrescriptionPrintDto.java @@ -1,12 +1,14 @@ package com.openhis.web.reportmanage.dto; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.openhis.common.annotation.Dict; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; /** * 西药(中成药)处方单 实体类 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportInitDto.java index ddff67e7..0cac4d83 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportInitDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 采购退货明细报表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportPageDto.java index 90d9edda..94a22fee 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportPageDto.java @@ -3,15 +3,16 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 采购退货明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportSearchParam.java index 82731e40..3e2b1941 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/PurchaseReturnReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 采购退货明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportInitDto.java index 80f52eb0..9b8f51c7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportInitDto.java @@ -3,12 +3,12 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.openhis.administration.domain.Practitioner; import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 挂号明细报表下拉框 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportPageDto.java index 5b4b1653..9f653bd6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportPageDto.java @@ -3,12 +3,17 @@ */ package com.openhis.web.reportmanage.dto; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; import java.math.BigDecimal; +import java.util.Date; /** * 挂号明细报表 dto diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportSearchParam.java index 2f866a37..6b8179b7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/RegisterReportSearchParam.java @@ -6,6 +6,8 @@ package com.openhis.web.reportmanage.dto; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Date; + /** * 挂号明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportBasicInformationDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportBasicInformationDetailsDto.java index 4cf5e545..255f6536 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportBasicInformationDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportBasicInformationDetailsDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.core.common.annotation.Excel; import com.fasterxml.jackson.annotation.JsonFormat; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 基本情况 dto * @@ -20,48 +21,32 @@ import java.math.BigDecimal; @Accessors(chain = true) public class ReportBasicInformationDetailsDto { - /** - * 序号 - */ + /** 序号 */ private String no; - /** - * 数据上报日期 - */ + /** 数据上报日期 */ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private String dataReportingDate; - /** - * 省级行政区划代码 - */ + /** 省级行政区划代码 */ private String provinceCodes; - /** - * 组织机构代码 - */ + /** 组织机构代码 */ private String organizationCode; - /** - * 医疗机构代码 - */ + /** 医疗机构代码 */ @Excel(name = "医疗机构代码", sort = 1) private String medicalCode; - /** - * 组织机构名称 - */ + /** 组织机构名称 */ @Excel(name = "组织机构名称", sort = 2) private String organizationName; - /** - * 年度药品总收入(元) - */ + /** 年度药品总收入(元) */ @Excel(name = "年度药品总收入(元)", sort = 3, scale = 2) private BigDecimal yearMedicineTotalRevenue; - /** - * 实有床位数 - */ + /** 实有床位数 */ private BigDecimal actualBedsNo; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDetailsSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDetailsSearchParam.java index 7205537f..43cb8eda 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDetailsSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDetailsSearchParam.java @@ -1,10 +1,10 @@ package com.openhis.web.reportmanage.dto; +import java.util.List; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 新增报表查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDiseaseDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDiseaseDetailsDto.java index ee1f7585..b4a743e7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDiseaseDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDiseaseDetailsDto.java @@ -3,6 +3,15 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDrugCostGrowthDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDrugCostGrowthDto.java index 6b9be6d6..97b3e0cf 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDrugCostGrowthDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportDrugCostGrowthDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 药品费用增长率 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationInboundDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationInboundDetailsDto.java index ba33ae72..16d01063 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationInboundDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationInboundDetailsDto.java @@ -3,12 +3,13 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.core.common.annotation.Excel; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 报表:药品入库情况初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationSaleDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationSaleDetailsDto.java index 8cc16322..088247fa 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationSaleDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationSaleDetailsDto.java @@ -3,6 +3,15 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationStockOutDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationStockOutDetailsDto.java index 643cb216..307cdf3d 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationStockOutDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationStockOutDetailsDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 药品出库情况 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationUsageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationUsageDto.java index 60cfa569..dda05398 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationUsageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportMedicationUsageDto.java @@ -3,12 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + +import com.core.common.annotation.Excel; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 药品使用情况报表始化 dto * @@ -19,56 +21,86 @@ import java.math.BigDecimal; @Accessors(chain = true) public class ReportMedicationUsageDto { - /** - * 医疗机构代码 - */ + /** 医疗机构代码 */ private String orgId; - /** - * 组织机构名称 - */ + /** 组织机构名称 */ private String orgName; - /** - * 国家药品编码(YPID) - */ + /** 国家药品编码(YPID) */ private String nationalDrugCode; - /** - * 院内药品唯一码 - */ + /** 院内药品唯一码 */ private String busNo; - /** - * 省级药品集中采购平台药品编码 - */ + /** 省级药品集中采购平台药品编码 */ private String provincialDrugCode; - /** - * 产品名称 - */ + /** 产品名称 */ private String itemName; - /** - * 销售总金额(元) - */ + /** 销售总金额(元) */ private BigDecimal totalSalesPrice; - /** - * 销售数量(最小销售包装单位) - */ + /** 销售数量(最小销售包装单位) */ private BigDecimal packageSalesQuantity; - /** - * 销售数量(最小制剂单位) - */ + /** 销售数量(最小制剂单位) */ private BigDecimal dosageSalesQuantity; - /** - * 单位 - */ + /** 单位 */ @Dict(dictCode = "unit_code") + @Excel(name = "包装", sort = 5, dictType = "unit_code") private Integer unitCode; private String unitCode_dictText; + /** 药品通用名 */ + @Excel(name = "药品通用名", sort = 1) + private String medName; + + /** 产品名称 */ + @Excel(name = "产品名称", sort = 2) + private String merchandiseName; + + /** 药品剂型 */ + @Dict(dictCode = "dose_form_code") + @Excel(name = "剂型", sort = 3, dictType = "dose_form_code") + private Integer doseFormCode; + private String doseFormCode_dictText; + + /** 药品规格 */ + @Excel(name = "规格", sort = 4) + private String totalVolume; + + /** 计价单位 */ + @Dict(dictCode = "unit_code") + @Excel(name = "计价单位", sort = 6, dictType = "unit_code") + private Integer priceUnit; + private String priceUnit_dictText; + + /** 生产厂家 */ + @Excel(name = "生产企业", sort = 7) + private String manufacturerText; + + /** 价格(每盒瓶/元) */ + @Excel(name = "价格(每盒瓶/元)", sort = 8, scale = 2) + private BigDecimal price; + + /** 患者参保地 */ + private String insuplcAdmdvs; + @Excel(name = "患者参保地", sort = 9) + private String insuplcAdmdvsText; + + /** 参保类型 */ + @Excel(name = "参保类型", sort = 10) + private String insutype; + + /** 使用数量(片袋支) */ + @Excel(name = "使用数量(片袋支)", sort = 11, scale = 2) + private BigDecimal dispenseQuantity; + + /** 使用金额(片袋支) */ + @Excel(name = "使用金额(片袋支)", sort = 12, scale = 2) + private BigDecimal totalAmount; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportNonWinQtyRatioDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportNonWinQtyRatioDto.java index c8e9897b..17c47beb 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportNonWinQtyRatioDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportNonWinQtyRatioDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 非中选产品采购量占比 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportOfflinePurchaseRatioDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportOfflinePurchaseRatioDto.java index 60b5a5c0..ae3bca5e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportOfflinePurchaseRatioDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportOfflinePurchaseRatioDto.java @@ -3,11 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 线下采购占比报表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsDto.java index 84b7632b..fbf2c3a9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsDto.java @@ -3,12 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + +import com.core.common.annotation.Excel; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 报表例子:患者明细初始化 dto * @@ -19,77 +21,64 @@ import java.math.BigDecimal; @Accessors(chain = true) public class ReportPatientDetailsDto { - /** - * 门诊住院号 - */ + /** 门诊住院号 */ + @Excel(name = "门诊住院号", sort = 1) private String encounterBusNo; - /** - * 药品通用名 - */ + /** 药品通用名 */ + @Excel(name = "药品通用名", sort = 2) private String medName; - /** - * 药品医保编码 - */ + /** 药品医保编码 */ + @Excel(name = "药品医保编码", sort = 3) private String medYbNo; - /** - * 药品类别 - */ + /** 药品类别 */ @Dict(dictCode = "med_category_code") + @Excel(name = "药品类别", sort = 4, dictType = "med_category_code") private String categoryCode; private String categoryCode_dictText; - /** - * 剂型 - */ + /** 剂型 */ @Dict(dictCode = "dose_form_code") + @Excel(name = "剂型", sort = 5, dictType = "dose_form_code") private String doseFormCode; private String doseFormCode_dictText; - /** - * 规格 - */ + /** 规格 */ + @Excel(name = "规格", sort = 6) private String totalVolume; - /** - * 包装 - */ + /** 包装 */ @Dict(dictCode = "unit_code") + @Excel(name = "包装", sort = 7, dictType = "unit_code") private String packageUnit; private String packageUnit_dictText; - /** - * 计价单位 - */ + /** 计价单位 */ @Dict(dictCode = "unit_code") + @Excel(name = "计价单位", sort = 8, dictType = "unit_code") private String unitCode; private String unitCode_dictText; - /** - * 是否中选产品 - */ + /** 是否中选产品 */ + @Excel(name = "是否中选产品", sort = 9) private String isSelected; - /** - * 生产企业 - */ + /** 生产企业 */ + @Excel(name = "生产企业", sort = 10) private String manufacturerText; - /** - * 单价(元) - */ + /** 单价(元) */ + @Excel(name = "单价(元)", sort = 11, scale = 2) private BigDecimal price; - /** - * 使用数量(片袋支) - */ + /** 使用数量(片袋支) */ + @Excel(name = "使用数量(片袋支)", sort = 12, scale = 2) private BigDecimal quantity; - /** - * 使用总金额(元) - */ + /** 使用总金额(元) */ + @Excel(name = "使用总金额(元)", sort = 13, scale = 2) private BigDecimal totalPrice; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsSearchParam.java index e708ccad..7f38e46b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientDetailsSearchParam.java @@ -3,6 +3,8 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import lombok.Data; import lombok.experimental.Accessors; @@ -26,9 +28,19 @@ public class ReportPatientDetailsSearchParam { private String medYbNo; /** 药品类别 */ - private String categoryCode; + private List categoryCodes; /** 生产企业 */ private String manufacturerText; + /** + * 药品使用 开始时间 + */ + private String startTime; + + /** + * 药品使用 结束时间 + */ + private String endTime; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailDto.java index 01701ad1..8807e9a9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailDto.java @@ -3,13 +3,15 @@ */ package com.openhis.web.reportmanage.dto; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.experimental.Accessors; - import java.math.BigDecimal; import java.util.Date; +import com.core.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; + +import lombok.Data; +import lombok.experimental.Accessors; + /** * 报表例子:患者明细主表初始化 dto * @@ -21,45 +23,58 @@ import java.util.Date; public class ReportPatientMasterDetailDto { /** 门诊住院号 */ + @Excel(name = "门诊住院号", sort = 1) private String encounterBusNo; /** 患者姓名 */ + @Excel(name = "患者姓名", sort = 2) private String patientName; /** 身份证号 */ + @Excel(name = "身份证号", sort = 3) private String idCard; /** 人员编码 */ + @Excel(name = "人员编码", sort = 4) private String psnNo; /** 参保地区编码 */ + @Excel(name = "参保地区", sort = 5) private String insuPlcNo; /** 参保类型 */ + @Excel(name = "参保类型", sort = 6) private String ybType; /** 入院时间 */ + @Excel(name = "入院时间", sort = 7, dateFormat = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date encounterStartTime; /** 出院时间 */ + @Excel(name = "出院时间", sort = 8, dateFormat = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date encounterEndTime; /** 处方日期 */ + @Excel(name = "处方日期", sort = 9, dateFormat = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date issueTime; /** 出院诊断 */ + @Excel(name = "出院诊断", sort = 10) private String outDiagnoseName; /** 总费用(元) */ + @Excel(name = "总费用(元)", sort = 11, scale = 2) private BigDecimal feeAmount; /** 政策范围内 */ + @Excel(name = "政策范围内", sort = 12, scale = 2) private BigDecimal inscpScpAmt; /** 基本医保统筹支付金额(元) */ + @Excel(name = "基本医保统筹支付金额(元)", sort = 13, scale = 2) private BigDecimal tcPayAmount; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailsSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailsSearchParam.java index c56d9ca3..fdcbdf06 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailsSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPatientMasterDetailsSearchParam.java @@ -3,6 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; @@ -25,4 +30,12 @@ public class ReportPatientMasterDetailsSearchParam { /** 身份证号 */ private String idCard; + /** 药品目录 */ + private List categoryCodes; + + /** + * 药品名称 + */ + private String medName; + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPhysicianWorkloadPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPhysicianWorkloadPageDto.java index 42a5fe5b..ba204d56 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPhysicianWorkloadPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportPhysicianWorkloadPageDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 同一:医生工作量报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportProductUsageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportProductUsageDto.java index 37297fd3..7e963c84 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportProductUsageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportProductUsageDto.java @@ -3,12 +3,13 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 产品使用情况始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportStockOutDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportStockOutDetailDto.java index c00749c9..8a425f8e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportStockOutDetailDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportStockOutDetailDto.java @@ -3,16 +3,18 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import com.openhis.common.annotation.Dict; import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 报表例子:出库明细表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportThirtyDayCollectionRateDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportThirtyDayCollectionRateDto.java index 97e4b2d9..648b2601 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportThirtyDayCollectionRateDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReportThirtyDayCollectionRateDto.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - /** * 报表例子:30天回款率 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportInitDto.java index a541b26b..569bbbd1 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportInitDto.java @@ -3,13 +3,14 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.List; + import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 退库明细报表初始化 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportPageDto.java index 172b00b9..fdef558f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportPageDto.java @@ -1,15 +1,16 @@ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 退库明细账分页列表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportSearchParam.java index 23c34fe5..128e8dd8 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ReturnIssueReportSearchParam.java @@ -1,10 +1,10 @@ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 领用退库明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportPageDto.java index 2c55d3c4..862d2d7a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportPageDto.java @@ -3,6 +3,9 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.core.common.annotation.Excel; @@ -10,12 +13,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 库存盘点明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportSearchParam.java index 71cc23bc..f56d8d14 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/StocktakingReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 库存盘点明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportPageDto.java index 95182692..e64e70f1 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportPageDto.java @@ -3,18 +3,19 @@ */ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.core.common.annotation.Excel; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; -import java.util.Date; - /** * 商品调拨明细报表 dto * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportSearchParam.java index 43007574..a0989157 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportSearchParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/TransferReportSearchParam.java @@ -3,11 +3,11 @@ */ package com.openhis.web.reportmanage.dto; +import java.util.Date; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.Date; - /** * 商品调拨明细查询条件 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/UnitTransformationDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/UnitTransformationDto.java new file mode 100644 index 00000000..6ce217b1 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/UnitTransformationDto.java @@ -0,0 +1,46 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.dto; + +import java.math.BigDecimal; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 单位转换 dto + * + * @author GYY + * @date 2025-04-22 + */ +@Data +@Accessors(chain = true) +public class UnitTransformationDto { + + /** + * 拆零比 + */ + private BigDecimal partPercent; + + /** + * 小单位数量 + */ + private BigDecimal minUnitQuantity; + + /** + * 商 | 整数部分,包装单位 + */ + private BigDecimal quotientQuantity; + + /** + * 余数 | 余数部分,小单位 + */ + private BigDecimal remainderQuantity; + + /** + * 拼接单位 | 即XXX盒XXX粒 + */ + private String strQuantity; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/WorkloadQueryParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/WorkloadQueryParam.java new file mode 100644 index 00000000..a71e4c2a --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/WorkloadQueryParam.java @@ -0,0 +1,69 @@ +package com.openhis.web.reportmanage.dto; + +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 工作量统计查询参数 + * + * @author swb + * @date 2026/1/8 + */ + +@Data +@Accessors(chain = true) +public class WorkloadQueryParam { + /** + * 绩效类型 + */ + private String performanceType; + + /** + * 财务类别 + */ + private List codes; + + /** + * 项目ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private List itemIds; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + /** + * 收费类型 1.实收 2.应收 + */ + private Integer amountType; + + /** + * 护士ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long nurseId; + + /** + * 仓库ID列表 + */ + @JsonSerialize(using = ToStringSerializer.class) + private List locationIds; + + /** + * 执行科室ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long orgId; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailDto.java new file mode 100644 index 00000000..995c2aff --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailDto.java @@ -0,0 +1,35 @@ +package com.openhis.web.reportmanage.dto; + +import java.util.List; + +import com.core.common.annotation.Excel; +import com.openhis.web.paymentmanage.dto.ChargeItemDto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 住院费用详情导出 + * + * @author swb + * @date 2026/1/20 + */ +@Data +@Accessors(chain = true) +public class ZyCostDetailDto { + + @Excel(name = "开单人", needMerge = true, sort = 1) + private String doctor; + + @Excel(name = "住院号", needMerge = true, sort = 2) + private String iptNo; + + @Excel(name = "病人", needMerge = true, sort = 3) + private String patientName; + + @Excel(name = "收费项", needMerge = true, sort = 4) + private String mergeTypeName; + + @Excel() + private List dataList; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailParam.java new file mode 100644 index 00000000..ec911c91 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/ZyCostDetailParam.java @@ -0,0 +1,62 @@ +package com.openhis.web.reportmanage.dto; + +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 住院费用详情查询参数 + * + * @author swb + * @date 2026/1/20 + */ +@Data +@Accessors(chain = true) +public class ZyCostDetailParam { + /** + * 统计类型 + */ + private String statisticalType; + + /** + * 结算状态 + */ + private Integer settleStatus = 1; + + /** + * 费用类型 + */ + private List feeType; + + /** + * 科室 + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long deptId; + + /** + * 医生 + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long doctorId; + + /** + * 床位 + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long bedId; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/workloadReportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/workloadReportDto.java index dfdb1de3..17934d68 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/workloadReportDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/dto/workloadReportDto.java @@ -1,11 +1,12 @@ package com.openhis.web.reportmanage.dto; +import java.math.BigDecimal; + import com.openhis.common.annotation.Dict; + import lombok.Data; import lombok.experimental.Accessors; -import java.math.BigDecimal; - @Data @Accessors(chain = true) public class workloadReportDto { @@ -32,14 +33,14 @@ public class workloadReportDto { */ @Dict(dictCode = "fin_type_code") private String chargeCode; - private String chargeCodeText; + private String chargeCode_dictText; /** * 医保类型 */ @Dict(dictCode = "med_chrgitm_type") private String ybChargeCode; - private String ybChargeCodeText; + private String ybChargeCode_dictText; /** * 类型 1缴费 2退费 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/AmbAdviceStatisticsAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/AmbAdviceStatisticsAppMapper.java new file mode 100644 index 00000000..bed77bc8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/AmbAdviceStatisticsAppMapper.java @@ -0,0 +1,57 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.openhis.web.reportmanage.dto.AmbActAdviceStatisticsDto; +import com.openhis.web.reportmanage.dto.AmbMedAdviceStatisticsDto; + +/** + * 门诊医嘱统计 mapper + * + * @author GYY + * @date 2025-04-22 + */ +@Repository +public interface AmbAdviceStatisticsAppMapper { + + /** + * 查询门诊药品医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param statusEnum 医嘱状态 | 已完成 + * @param classEnum 就诊类别 | 门诊 + * @return 门诊药品医嘱统计 + */ + List getMedStatistics(@Param("startTime") String startTime, + @Param("endTime") String endTime, @Param("contractNo") String contractNo, + @Param("patientName") String patientName, @Param("openOrgId") Long openOrgId, + @Param("statusEnum") Integer statusEnum, @Param("classEnum") Integer classEnum); + + /** + * 查询门诊诊疗医嘱统计 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param contractNo 费用性质编码 + * @param patientName 患者名称 + * @param openOrgId 开立科室id + * @param statusEnum 医嘱状态 | 已完成 + * @param classEnum 就诊类别 | 门诊 + * @return 门诊诊疗医嘱统计 + */ + List getActStatistics(@Param("startTime") String startTime, + @Param("endTime") String endTime, @Param("contractNo") String contractNo, + @Param("patientName") String patientName, @Param("openOrgId") Long openOrgId, + @Param("statusEnum") Integer statusEnum, @Param("classEnum") Integer classEnum); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/PharmacySettlementReportAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/PharmacySettlementReportAppMapper.java new file mode 100644 index 00000000..6af6c4e1 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/mapper/PharmacySettlementReportAppMapper.java @@ -0,0 +1,80 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.reportmanage.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.openhis.web.reportmanage.dto.PharmacySettlementMedDto; +import com.openhis.web.reportmanage.dto.PharmacySettlementReportDto; + +/** + * 药房结算报表 mapper + * + * @author GYY + * @date 2025-04-22 + */ +@Repository +public interface PharmacySettlementReportAppMapper { + + /** + * 查询药品列表 + * + * @param searchKey 模糊查询关键字 + * @return 药品列表 + */ + List getListInfo(@Param("searchKey") String searchKey); + + /** + * 查询发药信息 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param locationId 药房id + * @param completed 发药 + * @param refunded 退药 + * @return 发药信息 + */ + List getDispenseInfo(@Param("startTime") String startTime, + @Param("endTime") String endTime, @Param("locationId") Long locationId, @Param("completed") Integer completed, + @Param("refunded") Integer refunded); + + /** + * 查询药房供应信息 | 因盘点和调拨等业务单据数量存储的永远是小单位数量,故该查询数量和单位固定查小单位 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param locationId 药房id + * @param completed 发药 + * @param medTableName 药品定义表名 + * @param productBatchStocktaking 单据类型:批量盘点 + * @param productStocktaking 单据类型:盘点 + * @param productTransfer 单据类型:调拨 + * @param productBatchTransfer 单据类型:批量调拨 + * @param lossReportForm 单据类型:报损 + * @param issueInventory 单据类型:领用 + * @param returnIssue 单据类型:领用退货 + * @return 药房供应信息 + */ + List getSupplyRequestInfo(@Param("startTime") String startTime, + @Param("endTime") String endTime, @Param("locationId") Long locationId, @Param("completed") Integer completed, + @Param("medTableName") String medTableName, @Param("productBatchStocktaking") Integer productBatchStocktaking, + @Param("productStocktaking") Integer productStocktaking, @Param("productTransfer") Integer productTransfer, + @Param("productBatchTransfer") Integer productBatchTransfer, @Param("lossReportForm") Integer lossReportForm, + @Param("issueInventory") Integer issueInventory, @Param("returnIssue") Integer returnIssue); + + /** + * 查询药品库存信息 + * + * @param locationId 药房id + * @param medTableName 药品定义表名 + * @param conditionCode 命中条件: 药品进价 + * @return 药品库存信 + */ + List getInventoryInfo(@Param("locationId") Long locationId, + @Param("medTableName") String medTableName, @Param("conditionCode") String conditionCode); + +} diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/ThreePartPayMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/ThreePartPayMapper.xml new file mode 100644 index 00000000..cf5a0f94 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/paymentmanage/ThreePartPayMapper.xml @@ -0,0 +1,43 @@ + + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InHospitalReturnMedicineAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InHospitalReturnMedicineAppMapper.xml new file mode 100644 index 00000000..34995487 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/InHospitalReturnMedicineAppMapper.xml @@ -0,0 +1,165 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/AmbAdviceStatisticsAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/AmbAdviceStatisticsAppMapper.xml new file mode 100644 index 00000000..c5588ee6 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/AmbAdviceStatisticsAppMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/PharmacySettlementReportAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/PharmacySettlementReportAppMapper.xml new file mode 100644 index 00000000..5af6b728 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/PharmacySettlementReportAppMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ElePrescriptionType.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ElePrescriptionType.java new file mode 100644 index 00000000..d6ad7fd8 --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ElePrescriptionType.java @@ -0,0 +1,59 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 电子处方类别 + * + * @author liuhr + * @date 2025/4/21 + */ +@Getter +@AllArgsConstructor +public enum ElePrescriptionType implements HisEnumInterface { + + OUTPATIENT_WESTERN_OR_TRADITIONAL_CHINESE_MEDICINE(1, "1", "门诊西药中成药"), + + OUTPATIENT_CHINESE_MATERIAL_MEDICATED(2, "2", "门诊中药饮片"), + + EMERGENCY_WESTERN_OR_TRADITIONAL_CHINESE_MEDICINE(3, "3", "急诊西药中成药"), + + EMERGENCY_CHINESE_MATERIAL_MEDICATED(4, "4", "急诊中药饮片"), + + PEDIATRIC_WESTERN_OR_TRADITIONAL_CHINESE_MEDICINE(5, "5", "儿科西药中成药"), + + PEDIATRIC_CHINESE_MATERIAL_MEDICATED(6, "6", "儿科中药饮片"), + + NARCOTIC_OR_SPIRIT_FIRST_CLASS(7, "7", "麻、精一"), + + SPIRIT_SECOND_CLASS(8, "8", "精二"), + + CHINESE_MATERIAL_MEDICATED(9, "9", "中药饮片"), + + TRADITIONAL_CHINESE_MEDICINE_PREPARATION(10, "10", "中成药"), + + INPATIENT_WESTERN_OR_TRADITIONAL_CHINESE_MEDICINE(11, "11", "住院西药中成药"), + + OTHER(99, "99", "其它"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + public static ElePrescriptionType getByValue(Integer value) { + if (value == null) { + return null; + } + for (ElePrescriptionType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } + +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/FrequencyType.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/FrequencyType.java new file mode 100644 index 00000000..2a426ee8 --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/FrequencyType.java @@ -0,0 +1,31 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum FrequencyType implements HisEnumInterface { + + DAILY(1, "daily", "每日的"), + EVERY_OTHER_DAY(2, "every_other_day", "隔日的"), + WEEKLY(3, "weekly", "每周的"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + public static FrequencyType getByValue(Integer value) { + if (value == null) { + return null; + } + for (FrequencyType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/MedicalRecordStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/MedicalRecordStatus.java new file mode 100644 index 00000000..179c1d2f --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/MedicalRecordStatus.java @@ -0,0 +1,26 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 病案首页上传状态 + * + * @author swb + * @date 2025-01-04 + */ + +@Getter +@AllArgsConstructor +public enum MedicalRecordStatus { + PENDING_APPROVAL(0,"pending-approval","待审核"), + APPROVED(1,"approved","审核通过"), + UPLOADED(2,"uploaded ","已上传"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/PrescriptionCategory.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/PrescriptionCategory.java new file mode 100644 index 00000000..ebed17a7 --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/PrescriptionCategory.java @@ -0,0 +1,41 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 处方类别 | 对应字典 prescription_category + * + * @author liuhr + * @date 2025/4/21 + */ +@Getter +@AllArgsConstructor +public enum PrescriptionCategory implements HisEnumInterface { + + OUTPATIENT_PRESCRIPTION(1, "1", "门诊处方"), + + HOSPITALIZATION_ORDER(2, "2", "住院医嘱"), + + DISCHARGE_MEDICATION(3, "3", "出院带药"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + public static PrescriptionCategory getByValue(Integer value) { + if (value == null) { + return null; + } + for (PrescriptionCategory val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } + +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonEnum.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonEnum.java new file mode 100644 index 00000000..0563553d --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonEnum.java @@ -0,0 +1,57 @@ +package com.openhis.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 审方-存在问题枚举 + * + * @author swb + * @date 2026-01-29 + */ +@Getter +@AllArgsConstructor +public enum ReviewReasonEnum { + /** + * 适应证不适宜 + */ + INDICATION_INAPPROPRIATE("1", "INDICATION_INAPPROPRIATE", "适应证不适宜"), + + /** + * 遴选的药品不适宜 + */ + DRUG_SELECTION_INAPPROPRIATE("2", "DRUG_SELECTION_INAPPROPRIATE", "遴选的药品不适宜"), + + /** + * 药品剂型不适宜 + */ + DRUG_FORM_INAPPROPRIATE("3", "DRUG_FORM_INAPPROPRIATE", "药品剂型不适宜"), + + /** + * 用法用量不适宜 + */ + DOSAGE_USAGE_INAPPROPRIATE("4", "DOSAGE_USAGE_INAPPROPRIATE", "用法用量不适宜"), + + /** + * 联合用药不适宜 + */ + COMBINED_MEDICATION_INAPPROPRIATE("5", "COMBINED_MEDICATION_INAPPROPRIATE", "联合用药不适宜"), + + /** + * 重复给药 + */ + DUPLICATE_MEDICATION("6", "DUPLICATE_MEDICATION", "重复给药"); + + private final String value; + private final String code; + private final String info; + + public static String getByValue(String value) { + for (ReviewReasonEnum enumItem : values()) { + if (enumItem.getValue().equals(value)) { + return enumItem.getInfo(); + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonableStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonableStatus.java new file mode 100644 index 00000000..9135d27c --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReviewReasonableStatus.java @@ -0,0 +1,27 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 审方合理状态枚举 + * + * @author LAN + * @date 2026-01-29 + */ +@Getter +@AllArgsConstructor +public enum ReviewReasonableStatus implements HisEnumInterface { + UNREASONABLE(0, "0", "不合理"), + REASONABLE(1, "1", "合理"), + TO_BE_COMMENTED(2, "2", "待点评"); + + @EnumValue + @JsonValue + private final Integer value; + private final String code; + private final String info; +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SettleUpStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SettleUpStatus.java new file mode 100644 index 00000000..942d07aa --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SettleUpStatus.java @@ -0,0 +1,35 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 医保结算上传状态 + * + * @author swb + * @date 2026-02-02 + */ +@Getter +@AllArgsConstructor +public enum SettleUpStatus { + PENDING_APPROVAL(0,"not-submitted","未提交"), + APPROVED(1,"submitted","已提交"), + UPLOADED(2,"approved ","审核通过"), + SUBMITTED(3,"approval-rejected","审核不通过"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + + public static String getInfoByValue(Integer settleUploadStatus) { + for (SettleUpStatus value : values()) { + if (value.getValue().equals(settleUploadStatus)) { + return value.getInfo(); + } + } + return PENDING_APPROVAL.getInfo(); + } +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java new file mode 100644 index 00000000..ed46ac96 --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/SurgicalStatus.java @@ -0,0 +1,49 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 手术类型 + * + * @author swb + * @date 2025-12-25 + */ +@Getter +@AllArgsConstructor +public enum SurgicalStatus implements HisEnumInterface { + PREPARING(1, "1", "准备中"), + + IN_PROGRESS(2, "2", "进行中"), + + NOT_DONE(3, "3", "未做"), + + PAUSE(4, "4", "暂停"), + + STOP(5, "5", "停止"), + + COMPLETED(6, "6", "完成"), + + INPUT_ERROR(7, "7", "输入错误"), + + UNKNOWN(8, "8", "未知"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + public static SurgicalStatus getByValue(Integer value) { + if (value == null) { + return null; + } + for (SurgicalStatus val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ThreePartPayType.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ThreePartPayType.java new file mode 100644 index 00000000..ec91fb1d --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ThreePartPayType.java @@ -0,0 +1,45 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.common.enums; + +import com.github.pagehelper.util.StringUtil; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * ThreePartPayType (0: MEMBER_FIRST; 1: MEMBER_SECOND;) + * + * @author SunJQ + * @date 2026-01-12 + */ +@Getter +@AllArgsConstructor +public enum ThreePartPayType { + + /** + * 中行 + */ + BOC(0,"0", "中行"), + /** + * 云闪付 + */ + UNIONPAY(1,"1", "云闪付"); + + private Integer code; + private String value; + private String description; + + public static ThreePartPayType getByValue(String value) { + if (StringUtil.isEmpty(value)) { + return null; + } + for (ThreePartPayType val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/PrescriptionReviewRecord.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/PrescriptionReviewRecord.java new file mode 100644 index 00000000..9178358c --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/PrescriptionReviewRecord.java @@ -0,0 +1,64 @@ +package com.openhis.administration.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 处方点评记录实体类 + * + * @author swb + * @date 2026/1/29 + */ +@Data +@TableName("prescription_review_record") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class PrescriptionReviewRecord extends HisBaseEntity { + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + /** + * 处方号 + */ + private String prescriptionNo; + + /** + * 就诊ID + */ + private Long encounterId; + + /** + * 药品请求ids + */ + private String medRequestIds; + + /** + * 是否合理标识(0:不合理,1:合理,2:待点评) + */ + private Integer reasonableFlag; + + /** + * 存在问题 + */ + private String reasonEnum; + + /** + * 其他问题 + */ + private String reasonText; + + /** + * 点评药师ID + */ + private Long practitionerId; + +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/dto/OutpatientManageDto.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/dto/OutpatientManageDto.java new file mode 100644 index 00000000..1e91eb71 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/dto/OutpatientManageDto.java @@ -0,0 +1,112 @@ +package com.openhis.administration.dto; + +import java.util.Date; + +import com.core.common.annotation.Excel; +import liquibase.pro.packaged.E; +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊就诊记录Dto + * + * @author swb + * @date 2026/2/27 + */ +@Data +@Accessors(chain = true) +public class OutpatientManageDto { + /** + * 患者姓名 + */ + @Excel(name = "患者姓名",sort = 1, width = 20) + private String name; + + /** + * 患者身份证号 + */ + @Excel(name = "患者身份证号",sort = 2, width = 20) + private String idCard; + + /** + * 疾病(主诊断) + */ + @Excel(name = "疾病(主诊断)",sort = 3, width = 20) + private String description; + + /** + * 患者ID + */ + @Excel(name = "患者ID",sort = 4, width = 20) + private String patientBusNo; + + /** + * 门诊号 + */ + @Excel(name = "门诊号",sort = 5, width = 20) + private String encounterBusNo; + + /** + * 性别枚举 + */ + private Integer genderEnum; + @Excel(name = "性别",sort = 6, width = 20) + private String genderEnum_enumText; + + /** + * 出生日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date birthDate; + + /** + * 年龄 + */ + private String age; + + /** + * 患者手机号 + */ + @Excel(name = "患者手机号",sort = 7, width = 20) + private String phone; + + /** + * 就诊时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "就诊时间",sort = 8, width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date encounterTime; + + /** + * 就诊状态 + */ + private Integer subjectStatusEnum; + @Excel(name = "就诊状态",sort = 9, width = 20) + private String subjectStatusEnum_enumText; + + /** + * 医院名称 + */ + @Excel(name = "医院名称",sort = 10, width = 20) + private String organizationName; + + /** + * 接诊医生姓名 + */ + @Excel(name = "接诊医生姓名",sort = 11, width = 20) + private String doctorName; + + /** + * 医生ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private String doctorId; +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/domain/ThreePartPayRequest.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/domain/ThreePartPayRequest.java new file mode 100644 index 00000000..861b98bc --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/financial/domain/ThreePartPayRequest.java @@ -0,0 +1,72 @@ +package com.openhis.financial.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 第三方支付请求实体 + */ +@Data +@TableName("fin_three_part_pay_request") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class ThreePartPayRequest extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private BigDecimal id; + + /** + * payment表主键Id + */ + private Long paymentId; + + /** + * 请求金额 + */ + private BigDecimal amount; + + /** + * 扫码信息 + */ + private String scanKey; + + /** + * 请求时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date requestDate; + + /** + * 请求费用类型(1.挂号;2.门诊;3,住院;4.预交金;5,其他)暂时用不上这个字段 + */ + private String payType; + + /** + * 请求类型,暂时用PaymentType枚举 + */ + private String requestType; + + /** + * 请求人ID + */ + private Long requestPersonId; + + /** + * pos机号码 + */ + private String posNo; +} diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/domain/CatalogZySettleUp.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/domain/CatalogZySettleUp.java new file mode 100644 index 00000000..ad44e886 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/ybcatalog/domain/CatalogZySettleUp.java @@ -0,0 +1,76 @@ +package com.openhis.ybcatalog.domain; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 医保住院结算上传记录 + * + * @author swb + * @date 2026/2/2 + */ +@Data +@TableName("yb_catalog_zy_settle_up") +@Accessors(chain = true) +public class CatalogZySettleUp extends HisBaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_ID) + @JSONField(serialize = false) + private Long id; + + /** + * 院内就诊ID + */ + private Long encounterId; + + /** + * 人员编号 + */ + private String psnNo; + + /** + * 就诊ID + */ + private String mdtrtId; + + /** + * 结算ID + */ + private String setlId; + + /** + * 结算开始日期 + */ + private Date setlBegnDate; + + /** + * 结算结束日期 + */ + private Date setlEndDate; + + /** + * 4101A入参 + */ + private String param4101A; + + /** + * 4101A出参 + */ + private String result4101A; + + /** + * 结算上传状态 + */ + private String settleUpStatus; + +}