فهرست منبع

报表完成一大半

Huanyi 1 ماه پیش
والد
کامیت
4dd320e8fc
43فایلهای تغییر یافته به همراه1912 افزوده شده و 386 حذف شده
  1. 1 1
      .editorconfig
  2. 20 9
      ruoyi-admin/src/main/java/org/dromara/web/controller/ReportController.java
  3. 5 3
      ruoyi-admin/src/main/java/org/dromara/web/domain/ChargeRecord.java
  4. 2 1
      ruoyi-admin/src/main/java/org/dromara/web/domain/ChargeRecordLog.java
  5. 3 2
      ruoyi-admin/src/main/java/org/dromara/web/domain/EnteralNutrition.java
  6. 3 2
      ruoyi-admin/src/main/java/org/dromara/web/domain/HospitalMealRecipe.java
  7. 2 1
      ruoyi-admin/src/main/java/org/dromara/web/domain/InvoiceRecord.java
  8. 4 3
      ruoyi-admin/src/main/java/org/dromara/web/domain/ProductNutrition.java
  9. 2 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/Settlement.java
  10. 3 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/TreatmentUser.java
  11. 12 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostBo.java
  12. 23 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostFoodBo.java
  13. 25 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostPrescriptionBo.java
  14. 29 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/DietaryPrescriptionBo.java
  15. 67 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/EnteralNutritionPrescriptionBo.java
  16. 17 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/InHospitalBillingReconciliationBo.java
  17. 47 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/ListProductBo.java
  18. 17 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/bo/ProgressNoteBo.java
  19. 2 1
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ChargeRecordLogVo.java
  20. 3 3
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ChargeRecordVo.java
  21. 35 2
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/CookbookVo.java
  22. 32 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/CostPrescriptionVo.java
  23. 17 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/DietaryInventoryVo.java
  24. 21 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EnteralNutritionPrescriptionVo.java
  25. 43 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/FoodVo.java
  26. 83 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/InHospitalBillingReconciliationVo.java
  27. 40 1
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/InHospitalDietaryPrescriptionVo.java
  28. 128 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ListProductVo.java
  29. 57 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/OtherDietaryPrescriptionVo.java
  30. 43 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/PrescriptionDetailVo.java
  31. 48 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/PrescriptionVo.java
  32. 42 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ProductVo.java
  33. 98 0
      ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ProgressNoteVo.java
  34. 0 4
      ruoyi-admin/src/main/java/org/dromara/web/mapper/DailyMealPlanMapper.java
  35. 0 5
      ruoyi-admin/src/main/java/org/dromara/web/mapper/HospitalMealPlanMapper.java
  36. 8 1
      ruoyi-admin/src/main/java/org/dromara/web/service/ReportService.java
  37. 4 1
      ruoyi-admin/src/main/java/org/dromara/web/service/impl/ChargeRecordServiceImpl.java
  38. 3 3
      ruoyi-admin/src/main/java/org/dromara/web/service/impl/EnteralNutritionServiceImpl.java
  39. 660 83
      ruoyi-admin/src/main/java/org/dromara/web/service/impl/ReportServiceImpl.java
  40. 2 2
      ruoyi-admin/src/main/java/org/dromara/web/service/impl/SettlementServiceImpl.java
  41. 258 257
      ruoyi-admin/src/main/resources/application-dev.yml
  42. 1 1
      ruoyi-admin/src/main/resources/application.yml
  43. 2 0
      script/sql/biz/update.sql

+ 1 - 1
.editorconfig

@@ -11,7 +11,7 @@ trim_trailing_whitespace = true
 insert_final_newline = true
 
 [*.{json,yml,yaml}]
-indent_size = 2
+indent_size = 4
 
 [*.md]
 insert_final_newline = false

+ 20 - 9
ruoyi-admin/src/main/java/org/dromara/web/controller/ReportController.java

@@ -1,14 +1,12 @@
 package org.dromara.web.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import com.mysql.cj.xdevapi.Table;
 import lombok.RequiredArgsConstructor;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.web.domain.bo.*;
-import org.dromara.web.domain.vo.DietaryPrescriptionVo;
-import org.dromara.web.domain.vo.NutritionalQualityControlVo;
+import org.dromara.web.domain.vo.*;
 import org.dromara.web.service.ReportService;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -17,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.sql.Timestamp;
+import java.util.List;
 
 /**
  * @Author: Huanyi
@@ -33,6 +32,12 @@ public class ReportController {
 
     private final ReportService reportService;
 
+    @GetMapping("/listProduct")
+    @SaCheckPermission("report:product:list")
+    public TableDataInfo<ListProductVo> listProduct(ListProductBo bo, PageQuery pageQuery) {
+        return reportService.listProduct(bo, pageQuery);
+    }
+
     @GetMapping("/nutritionalQualityControl")
     @SaCheckPermission("report:nutritionQualityControl:list")
     public R<NutritionalQualityControlVo> getNutritionalQualityControl(
@@ -41,9 +46,15 @@ public class ReportController {
         return reportService.getNutritionalQualityControl(start, end);
     }
 
+    @GetMapping("/enteralNutrition")
+    @SaCheckPermission("report:enteralNutrition:list")
+    public TableDataInfo<PrescriptionVo> getEnteralNutrition(EnteralNutritionPrescriptionBo bo, PageQuery pageQuery) {
+        return reportService.getEnteralNutrition(bo, pageQuery);
+    }
+
     @GetMapping("/dietaryPrescription")
-    @SaCheckPermission("report:dietaryPrescription")
-    public TableDataInfo<DietaryPrescriptionVo> listPageDietaryPrescription(DietaryPrescriptionBo bo, PageQuery pageQuery) {
+    @SaCheckPermission("report:dietaryPrescription:list")
+    public TableDataInfo<InHospitalDietaryPrescriptionVo> listPageDietaryPrescription(DietaryPrescriptionBo bo, PageQuery pageQuery) {
         return reportService.listPageDietaryPrescription(bo, pageQuery);
     }
 
@@ -61,19 +72,19 @@ public class ReportController {
 
     @GetMapping("/inHospitalBillingReconciliation")
     @SaCheckPermission("report:inHospitalBillingReconciliation:list")
-    public TableDataInfo listPageInHospitalBillingReconciliation(InHospitalBillingReconciliationBo bo, PageQuery pageQuery) {
+    public TableDataInfo<InHospitalBillingReconciliationVo> listPageInHospitalBillingReconciliation(InHospitalBillingReconciliationBo bo, PageQuery pageQuery) {
         return reportService.listPageInHospitalBillingReconciliation(bo, pageQuery);
     }
 
     @GetMapping("/cost")
     @SaCheckPermission("report:cost:list")
-    public TableDataInfo listCost(CostBo bo, PageQuery pageQuery) {
-        return reportService.listCost(bo, pageQuery);
+    public R<List<CostPrescriptionVo>> listCost(CostBo bo) {
+        return reportService.listCost(bo);
     }
 
     @GetMapping("/progressNote")
     @SaCheckPermission("report:progressNote:list")
-    public TableDataInfo listPageProgressNote(ProgressNoteBo bo, PageQuery pageQuery) {
+    public TableDataInfo<ProgressNoteVo> listPageProgressNote(ProgressNoteBo bo, PageQuery pageQuery) {
         return reportService.listPageProgressNote(bo, pageQuery);
     }
 

+ 5 - 3
ruoyi-admin/src/main/java/org/dromara/web/domain/ChargeRecord.java

@@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
 import java.util.Date;
 
 import java.io.Serial;
@@ -81,17 +83,17 @@ public class ChargeRecord extends TenantEntity {
     /**
      * 订单金额
      */
-    private Long receivableAmount;
+    private BigDecimal receivableAmount;
 
     /**
      * 实收金额
      */
-    private Long fundsReceived;
+    private BigDecimal fundsReceived;
 
     /**
      * 退费金额
      */
-    private Long refundAmount;
+    private BigDecimal refundAmount;
 
     /**
      * 支付状态(未支付/已支付/已退款)

+ 2 - 1
ruoyi-admin/src/main/java/org/dromara/web/domain/ChargeRecordLog.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.io.Serial;
+import java.math.BigDecimal;
 
 /**
  * 收费操作记录对象 charge_record_log
@@ -50,7 +51,7 @@ public class ChargeRecordLog extends TenantEntity {
     /**
      * 交易金额
      */
-    private Long receivableAmount;
+    private BigDecimal receivableAmount;
 
     /**
      * 备注

+ 3 - 2
ruoyi-admin/src/main/java/org/dromara/web/domain/EnteralNutrition.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalTime;
 import java.util.Date;
@@ -101,7 +102,7 @@ public class EnteralNutrition extends TenantEntity {
     /**
      * 用量/总
      */
-    private String totalDose;
+    private BigDecimal totalDose;
 
     /**
      * 规格
@@ -142,7 +143,7 @@ public class EnteralNutrition extends TenantEntity {
     /**
      * 金额
      */
-    private Long amount;
+    private BigDecimal amount;
 
     /**
      * 状态(0正常 1停用)

+ 3 - 2
ruoyi-admin/src/main/java/org/dromara/web/domain/HospitalMealRecipe.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalTime;
 import java.util.Date;
@@ -75,7 +76,7 @@ public class HospitalMealRecipe extends TenantEntity {
     /**
      * 食物重量(g)
      */
-    private Long foodWeight;
+    private BigDecimal foodWeight;
 
     /**
      * 热量(kcal)
@@ -90,7 +91,7 @@ public class HospitalMealRecipe extends TenantEntity {
     /**
      * 金额
      */
-    private Long price;
+    private BigDecimal price;
 
     /**
      * 删除标志(0代表存在 1代表删除)

+ 2 - 1
ruoyi-admin/src/main/java/org/dromara/web/domain/InvoiceRecord.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.io.Serial;
+import java.math.BigDecimal;
 
 /**
  * 开票记录对象 invoice_record
@@ -60,7 +61,7 @@ public class InvoiceRecord extends TenantEntity {
     /**
      * 开票金额
      */
-    private Long amount;
+    private BigDecimal amount;
 
     /**
      * 开票进度

+ 4 - 3
ruoyi-admin/src/main/java/org/dromara/web/domain/ProductNutrition.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -124,7 +125,7 @@ public class ProductNutrition extends TenantEntity {
     /**
      * 入货价格
      */
-    private Long purchasePrice;
+    private BigDecimal purchasePrice;
 
     /**
      * 入货单位
@@ -154,7 +155,7 @@ public class ProductNutrition extends TenantEntity {
     /**
      * 预包装销售价
      */
-    private Long packagePrice;
+    private BigDecimal packagePrice;
 
     /**
      * 最小包装单位
@@ -174,7 +175,7 @@ public class ProductNutrition extends TenantEntity {
     /**
      * 配置销售价格
      */
-    private Long configSalePrice;
+    private BigDecimal configSalePrice;
 
     /**
      * 配置损耗率

+ 2 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/Settlement.java

@@ -119,4 +119,6 @@ public class Settlement extends TenantEntity {
     private String checkStatus;
 
     private String remark;
+
+    private String transactionId;
 }

+ 3 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/TreatmentUser.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.io.Serial;
+import java.math.BigDecimal;
 
 /**
  * 【待诊患者】对象 treatment_user
@@ -131,4 +132,6 @@ public class TreatmentUser extends BaseEntity {
 
     private String wardName;
 
+    private BigDecimal bmi;
+
 }

+ 12 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostBo.java

@@ -11,4 +11,16 @@ import lombok.Data;
 
 @Data
 public class CostBo {
+
+    /**
+     * 1、院内膳食处方
+     * 2、预包装处方
+     * 3、配置处方
+     * 4、长期医嘱处方
+     */
+    private Integer type;
+
+    private CostPrescriptionBo prescription;
+
+    private CostFoodBo food;
 }

+ 23 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostFoodBo.java

@@ -0,0 +1,23 @@
+package org.dromara.web.domain.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class CostFoodBo {
+
+    private Date createTimeEarliest;
+
+    private Date createTimeLatest;
+
+    private String foodName;
+
+}

+ 25 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/CostPrescriptionBo.java

@@ -0,0 +1,25 @@
+package org.dromara.web.domain.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class CostPrescriptionBo {
+
+    private Date createTimeEarliest;
+
+    private Date createTimeLatest;
+
+    private Long departmentId;
+
+    private Integer productType;
+
+}

+ 29 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/DietaryPrescriptionBo.java

@@ -14,22 +14,51 @@ import java.util.Date;
 @Data
 public class DietaryPrescriptionBo {
 
+    /**
+     * 最早交易时间
+     */
     private Date tradeDateEarliest;
 
+    /**
+     * 最晚交易时间
+     */
     private Date tradeDateLatest;
 
+    /**
+     * 最早开方时间
+     */
     private Date calculationDateEarliest;
 
+    /**
+     * 最晚开方时间
+     */
     private Date calculationDateLatest;
 
+    /**
+     * 看诊类型
+     */
     private Integer consultationType;
 
+    /**
+     * 医生科室ID
+     */
     private Long doctorDepartmentId;
 
+    /**
+     * 患者科室ID
+     */
     private Long patientDepartmentId;
 
+    /**
+     * 患者姓名
+     */
     private String name;
 
+    /**
+     * 膳食类型
+     * 0、院内膳食
+     * 1、其他膳食
+     */
     private Integer dietaryType;
 
 }

+ 67 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/EnteralNutritionPrescriptionBo.java

@@ -0,0 +1,67 @@
+package org.dromara.web.domain.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class EnteralNutritionPrescriptionBo {
+
+    /**
+     * 最早交易日期
+     */
+    private Date tradeDateEarliest;
+
+    /**
+     * 最晚交易日期
+     */
+    private Date tradeDateLatest;
+
+    /**
+     * 最早开方日期
+     */
+    private Date createDateEarliest;
+
+    /**
+     * 最晚开方日期
+     */
+    private Date createDateLatest;
+
+    /**
+     * 看诊类型
+     */
+    private String consultationType;
+
+    /**
+     * 支付状态
+     */
+    private String payStatus;
+
+    /**
+     * 医生科室ID
+     */
+    private Long doctorDepartmentId;
+
+    /**
+     * 患者科室ID
+     */
+    private Long patientDepartmentId;
+
+    /**
+     * 处方类型
+     */
+    private Integer nutritionType;
+
+    /**
+     * 产品名称
+     */
+    private String productName;
+
+}

+ 17 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/InHospitalBillingReconciliationBo.java

@@ -2,6 +2,8 @@ package org.dromara.web.domain.bo;
 
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * @Author: Huanyi
  * @CreateTime: 2025-08-18
@@ -11,4 +13,19 @@ import lombok.Data;
 
 @Data
 public class InHospitalBillingReconciliationBo {
+
+    private Date tradeDateEarliest;
+
+    private Date tradeDateLatest;
+
+    private Long patientDepartmentId;
+
+    private Long departmentId;
+
+    private Integer consultationType;
+
+    private String payStatus;
+
+    private String payMethod;
+
 }

+ 47 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/ListProductBo.java

@@ -0,0 +1,47 @@
+package org.dromara.web.domain.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class ListProductBo {
+
+    /**
+     * 最早交易日期
+     */
+    private Date tradeDateEarliest;
+
+    /**
+     * 最晚交易日期
+     */
+    private Date tradeDateLatest;
+
+    /**
+     * 生产厂商ID
+     */
+    private String manufacturerId;
+
+    /**
+     * 供应商ID
+     */
+    private String providerId;
+
+    /**
+     * 商品类型
+     */
+    private Integer productType;
+
+    /**
+     * 商品名称
+     */
+    private String productName;
+
+}

+ 17 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/ProgressNoteBo.java

@@ -2,6 +2,8 @@ package org.dromara.web.domain.bo;
 
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * @Author: Huanyi
  * @CreateTime: 2025-08-18
@@ -11,4 +13,19 @@ import lombok.Data;
 
 @Data
 public class ProgressNoteBo {
+
+    private Date createTimeEarliest;
+
+    private Date createTimeLatest;
+
+    /**
+     * 患者科室ID
+     */
+    private String patientDepartmentId;
+
+    /**
+     * 患者姓名
+     */
+    private String patient;
+
 }

+ 2 - 1
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ChargeRecordLogVo.java

@@ -8,6 +8,7 @@ import org.dromara.web.domain.ChargeRecordLog;
 
 import java.io.Serial;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 
@@ -56,7 +57,7 @@ public class ChargeRecordLogVo implements Serializable {
      * 交易金额
      */
     @ExcelProperty(value = "交易金额")
-    private Long receivableAmount;
+    private BigDecimal receivableAmount;
 
     /**
      * 备注

+ 3 - 3
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ChargeRecordVo.java

@@ -103,19 +103,19 @@ public class ChargeRecordVo implements Serializable {
      * 订单金额
      */
     @ExcelProperty(value = "订单金额")
-    private Long receivableAmount;
+    private BigDecimal receivableAmount;
 
     /**
      * 实收金额
      */
     @ExcelProperty(value = "实收金额")
-    private Long fundsReceived;
+    private BigDecimal fundsReceived;
 
     /**
      * 退费金额
      */
     @ExcelProperty(value = "退费金额")
-    private Long refundAmount;
+    private BigDecimal refundAmount;
 
     /**
      * 支付状态(未支付/已支付/已退款)

+ 35 - 2
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/CookbookVo.java

@@ -3,6 +3,7 @@ package org.dromara.web.domain.vo;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -13,13 +14,45 @@ import java.util.List;
  */
 
 @Data
-@AllArgsConstructor
 public class CookbookVo {
 
+    /**
+     * 食谱名称
+     */
     private String cookbookName;
 
     /**
-     * 食材
+     * 食材总量
+     */
+    private BigDecimal total;
+
+    /**
+     * 食谱单价
+     */
+    private BigDecimal price;
+
+    /**
+     * 份数
+     */
+    private Long count;
+
+    /**
+     * 退费份数
+     */
+    private Long refundCount;
+
+    /**
+     * 退费金额
+     */
+    private BigDecimal refundAmount;
+
+    /**
+     * 退费消耗金额
+     */
+    private BigDecimal refundDeductionAmount;
+
+    /**
+     * 食材明细
      */
     private List<String> ingredients;
 

+ 32 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/CostPrescriptionVo.java

@@ -0,0 +1,32 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class CostPrescriptionVo {
+
+    /**
+     * 科室ID
+     */
+    private Long id;
+
+    /**
+     * 科室名称
+     */
+    private String name;
+
+    /**
+     * 产品列表
+     */
+    private List<ProductVo> productList;
+
+}

+ 17 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/DietaryInventoryVo.java

@@ -0,0 +1,17 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class DietaryInventoryVo {
+
+
+
+}

+ 21 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EnteralNutritionPrescriptionVo.java

@@ -0,0 +1,21 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class EnteralNutritionPrescriptionVo {
+
+    private List<PrescriptionVo> list;
+
+    private Long count;
+
+}

+ 43 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/FoodVo.java

@@ -0,0 +1,43 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class FoodVo {
+
+    /**
+     * 菜肴名称
+     */
+    private String foodName;
+
+    /**
+     * 食材明细
+     */
+    private List<String> ingredients;
+
+    /**
+     * 销售数量(分)
+     */
+    private Integer account;
+
+    /**
+     * 食材成本(元)
+     */
+    private BigDecimal cost;
+
+    /**
+     * 销售金额(元)
+     */
+    private BigDecimal amount;
+
+}

+ 83 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/InHospitalBillingReconciliationVo.java

@@ -0,0 +1,83 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class InHospitalBillingReconciliationVo {
+
+    /**
+     * 交易时间
+     */
+    private Date createTime;
+
+    /**
+     * 患者科室
+     */
+    private String patientDepartment;
+
+    /**
+     * 患者
+     */
+    private String patient;
+
+    /**
+     * 身份证号
+     */
+    private String cardId;
+
+    /**
+     * 看诊类型
+     */
+    private String consultationType;
+
+    /**
+     * 门诊/住院号
+     */
+    private String medicalId;
+
+    /**
+     * 订单类型
+     */
+    private String orderType;
+
+    /**
+     * 开单医生/护士
+     */
+    private String doctor;
+
+    /**
+     * 科室
+     */
+    private String department;
+
+    /**
+     * 订单金额(元)
+     */
+    private BigDecimal amount;
+
+    /**
+     * 支付方式
+     */
+    private String payMethod;
+
+    /**
+     * 操作人
+     */
+    private String actioner;
+
+    /**
+     * 交易单号
+     */
+    private String transactionId;
+
+}

+ 40 - 1
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/DietaryPrescriptionVo.java → ruoyi-admin/src/main/java/org/dromara/web/domain/vo/InHospitalDietaryPrescriptionVo.java

@@ -2,6 +2,7 @@ package org.dromara.web.domain.vo;
 
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -13,34 +14,72 @@ import java.util.List;
  */
 
 @Data
-public class DietaryPrescriptionVo {
+public class InHospitalDietaryPrescriptionVo {
 
+    /**
+     * 处方ID
+     */
     private Long id;
 
+    /**
+     * 交易日期
+     */
     private Date tradeDate;
 
+    /**
+     * 开方日期
+     */
     private Date calculationDate;
 
+    /**
+     * 看诊类型
+     */
     private String consultationType;
 
+    /**
+     * 开放医生科室
+     */
     private String calculationDoctorDepartment;
 
+    /**
+     * 开放医生
+     */
     private String calculationDoctor;
 
+    /**
+     * 患者科室
+     */
     private String patientDepartment;
 
+    /**
+     * 患者姓名
+     */
     private String patientName;
 
+    /**
+     * 支付状态
+     */
     private String payStatus;
 
+    /**
+     * 膳食金额
+     */
+    private BigDecimal dietaryExpenses;
+
     /**
      * 餐次
      */
+    // 早餐
     private List<CookbookVo> breakfast;
+    // 早加
     private List<CookbookVo> breakfastExtra;
+    // 中餐
     private List<CookbookVo> lunch;
+    // 中加
     private List<CookbookVo> lunchExtra;
+    // 晚餐
     private List<CookbookVo> dinner;
+    // 晚加
     private List<CookbookVo> dinnerExtra;
 
 }

+ 128 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ListProductVo.java

@@ -0,0 +1,128 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class ListProductVo {
+
+    /**
+     * 交易日期
+     */
+    private Date tradeDate;
+
+    /**
+     * 院方系统编码
+     */
+    private String hospitalSystemCode;
+
+    /**
+     * 商品类型
+     */
+    private String productType;
+
+    /**
+     * 商品分类
+     */
+    private String productClassification;
+
+    /**
+     * 商品名称
+     */
+    private String productName;
+
+    /**
+     * 商品规格
+     */
+    private String productSpecification;
+
+    /**
+     * 供应商名称
+     */
+    private String providerName;
+
+    /**
+     * 生产厂商名称
+     */
+    private String manufacturerName;
+
+    /**
+     * 预包装销售数量/单位
+     */
+    private String prePackageSalesVolume;
+
+    /**
+     * 预包装销售金额(元)
+     */
+    private BigDecimal prePackageSalesAmount;
+
+    /**
+     * 预包装入货单价(元)
+     */
+    private BigDecimal prePackagePurchaseUnitPrice;
+
+    /**
+     * 预包装入货金额(元)
+     */
+    private BigDecimal prePackagePurchaseAmount;
+
+    /**
+     * 配置销售数量/单位
+     */
+    private String configureSalesVolume;
+
+    /**
+     * 配置销售金额(元)
+     */
+    private BigDecimal configureSalesAmount;
+
+    /**
+     * 长期医嘱销售数量/单位
+     */
+    private String longTermPrescriptionSalesVolume;
+
+    /**
+     * 长期医嘱销售金额(元)
+     */
+    private BigDecimal longTermPrescriptionSalesAmount;
+
+    /**
+     * 预包装退费数量/单位
+     */
+    private String prePackageRefundVolume;
+
+    /**
+     * 预包装退费金额(元)
+     */
+    private BigDecimal prePackageRefundAmount;
+
+    /**
+     * 配置退费数量/单位
+     */
+    private String configureRefundVolume;
+
+    /**
+     * 配置退费金额(元)
+     */
+    private BigDecimal configureRefundAmount;
+
+    /**
+     * 长期医嘱退费数量/单位
+     */
+    private String longTermPrescriptionRefundVolume;
+
+    /**
+     * 长期医嘱退费金额(元)
+     */
+    private BigDecimal longTermPrescriptionRefundAmount;
+
+}

+ 57 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/OtherDietaryPrescriptionVo.java

@@ -0,0 +1,57 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class OtherDietaryPrescriptionVo {
+
+    /**
+     * 处方ID
+     */
+    private Long id;
+
+    /**
+     * 开方日期
+     */
+    private Date createTime;
+
+    /**
+     * 看诊类型
+     */
+    private String consultationType;
+
+    /**
+     * 膳食类型
+     */
+    private String dietaryType;
+
+    /**
+     * 开方医生科室
+     */
+    private String doctorDepartment;
+
+    /**
+     * 开方医生
+     */
+    private String doctor;
+
+    /**
+     * 患者科室
+     */
+    private String patientDepartment;
+
+    /**
+     * 患者姓名
+     */
+    private String patient;
+
+}

+ 43 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/PrescriptionDetailVo.java

@@ -0,0 +1,43 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class PrescriptionDetailVo {
+
+    private String name;
+
+    private String specsName;
+
+    private BigDecimal unitDosage;
+
+    private BigDecimal unitPrice;
+
+    private String productNo;
+
+    private String specsUnitName;
+
+    private String refundDosage;
+
+    private String lossDosage;
+
+    private Integer groupNo;
+
+    private Integer totalNum;
+
+    private Integer configNum;
+
+    private Integer configRefundNum;
+
+    private BigDecimal configAmount;
+
+}

+ 48 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/PrescriptionVo.java

@@ -0,0 +1,48 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-20
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class PrescriptionVo {
+
+    private long prescriptionId;
+
+    private Date tradeTime;
+
+    private Date openingDate;
+
+    private String patientVisitTypeName;
+
+    private String patientName;
+
+    private String modelTypeName;
+
+    private String doctorDeptName;
+
+    private String doctorUserName;
+
+    private String doctorWorkNo;
+
+    private String payStatusName;
+
+    private BigDecimal realPrice;
+
+    private BigDecimal realRefundPrice;
+
+    private BigDecimal realLossPrice;
+
+    private String patientDeptName;
+
+    List<PrescriptionDetailVo> detailList;
+}

+ 42 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ProductVo.java

@@ -0,0 +1,42 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class ProductVo {
+
+    /**
+     * 商品ID
+     */
+    private Long id;
+
+    /**
+     * 商品名称
+     */
+    private String name;
+
+    /**
+     * 销售数量
+     */
+    private Integer salesQuantity;
+
+    /**
+     * 销售成本
+     */
+    private BigDecimal salesCost;
+
+    /**
+     * 销售金额
+     */
+    private BigDecimal salesAmount;
+
+}

+ 98 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/ProgressNoteVo.java

@@ -0,0 +1,98 @@
+package org.dromara.web.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author: Huanyi
+ * @CreateTime: 2025-08-19
+ * @Description:
+ * @Version: 1.0
+ */
+
+@Data
+public class ProgressNoteVo {
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 身高(cm)
+     */
+    private String height;
+
+    /**
+     * 体重(kg)
+     */
+    private String weight;
+
+    /**
+     * BMI
+     */
+    private BigDecimal bmi;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 看诊类型
+     */
+    private String consultationType;
+
+    /**
+     * 患者科室
+     */
+    private String patientDepartment;
+
+    /**
+     * 门诊/住院号
+     */
+    private String medicalId;
+
+    /**
+     * 挂号/入院时间
+     */
+    private Date createTime;
+
+    /**
+     * 营养筛查次数
+     */
+    private Integer nutritionScreeningCount;
+
+    /**
+     * 营养评估次数
+     */
+    private Integer nutritionAssessmentCount;
+
+    /**
+     * 营养诊断次数
+     */
+    private Integer nutritionDiagnosesCount;
+
+    /**
+     * 营养干预处方次数
+     */
+    private Integer nutritionInterventionCount;
+
+    /**
+     * 营养膳食处方次数
+     */
+    private Integer nutritionMealCount;
+
+    /**
+     * 营养宣教次数
+     */
+    private Integer nutritionEducationCount;
+
+    /**
+     * 费用合计
+     */
+    private BigDecimal amount;
+
+}

+ 0 - 4
ruoyi-admin/src/main/java/org/dromara/web/mapper/DailyMealPlanMapper.java

@@ -1,13 +1,9 @@
 package org.dromara.web.mapper;
 
 
-import org.apache.ibatis.annotations.Select;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
-import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.web.domain.DailyMealPlan;
-import org.dromara.web.domain.bo.DietaryPrescriptionBo;
 import org.dromara.web.domain.vo.DailyMealPlanVo;
-import org.dromara.web.domain.vo.DietaryPrescriptionVo;
 import org.springframework.stereotype.Repository;
 
 /**

+ 0 - 5
ruoyi-admin/src/main/java/org/dromara/web/mapper/HospitalMealPlanMapper.java

@@ -4,16 +4,11 @@ package org.dromara.web.mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
-import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.web.domain.HospitalMealPlan;
-import org.dromara.web.domain.bo.DietaryPrescriptionBo;
-import org.dromara.web.domain.vo.DietaryPrescriptionVo;
-import org.dromara.web.domain.vo.EnteralNutritionQueryOneVo;
 import org.dromara.web.domain.vo.HospitalMealPlanQueryVo;
 import org.dromara.web.domain.vo.HospitalMealPlanVo;
 import org.springframework.stereotype.Repository;
 
-import java.util.Date;
 import java.util.List;
 
 /**

+ 8 - 1
ruoyi-admin/src/main/java/org/dromara/web/service/ReportService.java

@@ -4,6 +4,9 @@ import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.web.domain.bo.*;
+import org.dromara.web.domain.vo.EnteralNutritionPrescriptionVo;
+import org.dromara.web.domain.vo.ListProductVo;
+import org.dromara.web.domain.vo.PrescriptionVo;
 
 import java.sql.Timestamp;
 
@@ -26,9 +29,13 @@ public interface ReportService {
 
     TableDataInfo listPageInHospitalBillingReconciliation(InHospitalBillingReconciliationBo bo, PageQuery pageQuery);
 
-    TableDataInfo listCost(CostBo bo, PageQuery pageQuery);
+    R listCost(CostBo bo);
 
     TableDataInfo listPageProgressNote(ProgressNoteBo bo, PageQuery pageQuery);
 
     R getIntraHospitalData(Timestamp start, Timestamp end, Long id);
+
+    TableDataInfo<PrescriptionVo> getEnteralNutrition(EnteralNutritionPrescriptionBo bo, PageQuery pageQuery);
+
+    TableDataInfo<ListProductVo> listProduct(ListProductBo bo, PageQuery pageQuery);
 }

+ 4 - 1
ruoyi-admin/src/main/java/org/dromara/web/service/impl/ChargeRecordServiceImpl.java

@@ -3,6 +3,7 @@ package org.dromara.web.service.impl;
 import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.dromara.common.core.domain.R;
+import org.dromara.common.core.domain.model.LoginUser;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -15,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.core.enums.biz.ActionStatus;
 import org.dromara.common.core.enums.biz.FeeType;
 import org.dromara.common.core.enums.biz.PaymentStatus;
+import org.dromara.common.satoken.utils.LoginHelper;
 import org.dromara.system.domain.SysDept;
 import org.dromara.system.domain.SysUser;
 import org.dromara.system.mapper.SysDeptMapper;
@@ -96,7 +98,7 @@ public class ChargeRecordServiceImpl implements IChargeRecordService {
                         ProductNutrition productNutrition = productNutritionMap.get(nutritionVo.getNutritionProductId());
 
                         if (productNutrition != null) {
-                            BigDecimal price = FeeType.PRE_PACKAGED_PRESCRIPTION.getCode().equals(chargeType) ? new BigDecimal(productNutrition.getPackagePrice()) : new BigDecimal(productNutrition.getConfigSalePrice());
+                            BigDecimal price = FeeType.PRE_PACKAGED_PRESCRIPTION.getCode().equals(chargeType) ? productNutrition.getPackagePrice() : productNutrition.getConfigSalePrice();
                             nutritionVo.setSalePrice(price);
                         }
                     }
@@ -213,6 +215,7 @@ public class ChargeRecordServiceImpl implements IChargeRecordService {
     public Boolean insertByBo(ChargeRecordBo bo) {
         bo.setId(null);
         bo.setPaymentStatus(PaymentStatus.PAID.getCode());
+        bo.setCreateDept(LoginHelper.getDeptId());
         ChargeRecord add = MapstructUtils.convert(bo, ChargeRecord.class);
         validEntityBeforeSave(add);
         boolean flag = baseMapper.insert(add) > 0;

+ 3 - 3
ruoyi-admin/src/main/java/org/dromara/web/service/impl/EnteralNutritionServiceImpl.java

@@ -443,7 +443,7 @@ public class EnteralNutritionServiceImpl implements IEnteralNutritionService {
                     throw new ServiceException("数量不能为空");
                 }
 
-                nutritionBo.setAmount(BigDecimal.valueOf(nutritionBo.getQuantity() * nutrition.getPackagePrice()).multiply(new BigDecimal(nutrition.getProductSpec())).multiply(nutritionBo.getDosePerTime()));
+                nutritionBo.setAmount(nutrition.getPackagePrice().multiply(new BigDecimal(nutritionBo.getQuantity())).multiply(new BigDecimal(nutrition.getProductSpec())).multiply(nutritionBo.getDosePerTime()));
 
                 nutritionBo.setDailyCalories(BigDecimal.valueOf(nutrition.getCalorie() * nutritionBo.getFrequency() / 100.0).multiply(nutritionBo.getDosePerTime()));
 
@@ -488,7 +488,7 @@ public class EnteralNutritionServiceImpl implements IEnteralNutritionService {
                         throw new ServiceException("首日不能为空");
                     }
 
-                    product.setAmount(BigDecimal.valueOf(nutrition.getConfigSalePrice() * (nutritionBo.getFrequency() * (nutritionBo.getUsageDays() - 1) + nutritionBo.getFirstDay())).multiply(product.getDosePerTime()));
+                    product.setAmount(nutrition.getConfigSalePrice().multiply(new BigDecimal(nutritionBo.getFrequency() * (nutritionBo.getUsageDays() - 1) + nutritionBo.getFirstDay())).multiply(product.getDosePerTime()));
                     product.setAmount(BigDecimal.ZERO.compareTo(product.getAmount()) > 0 ? BigDecimal.ZERO : product.getAmount());
 
                     product.setDailyCalories(BigDecimal.valueOf(nutrition.getCalorie() * nutritionBo.getFrequency() / 100.0).multiply(product.getDosePerTime()));
@@ -513,7 +513,7 @@ public class EnteralNutritionServiceImpl implements IEnteralNutritionService {
                     long days = DateUtil.between(nutritionBo.getPrescriptionDate(), product.getStopDate(), DateUnit.DAY) + 1;
                     product.setUsageDays(days);
 
-                    product.setAmount(BigDecimal.valueOf(((days - 1) * nutritionBo.getFrequency() + nutritionBo.getFirstDay()) * nutrition.getConfigSalePrice()).multiply(product.getDosePerTime()));
+                    product.setAmount(nutrition.getConfigSalePrice().multiply(new BigDecimal((days - 1) * nutritionBo.getFrequency() + nutritionBo.getFirstDay())).multiply(product.getDosePerTime()));
                     product.setAmount(BigDecimal.ZERO.compareTo(product.getAmount()) > 0 ? BigDecimal.ZERO : product.getAmount());
 
                     product.setDailyCalories(BigDecimal.valueOf(nutrition.getCalorie() * nutritionBo.getFrequency() / 100.0).multiply(product.getDosePerTime()));

+ 660 - 83
ruoyi-admin/src/main/java/org/dromara/web/service/impl/ReportServiceImpl.java

@@ -1,9 +1,10 @@
 package org.dromara.web.service.impl;
 import java.math.BigDecimal;
-import com.google.common.collect.Lists;
+import java.util.Date;
 
 import java.util.*;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
@@ -11,12 +12,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.system.domain.SysDept;
+import org.dromara.system.domain.SysFoodIngredient;
+import org.dromara.system.domain.SysRecipe;
 import org.dromara.system.mapper.*;
 import org.dromara.web.domain.*;
 import org.dromara.web.domain.bo.*;
-import org.dromara.web.domain.vo.CookbookVo;
-import org.dromara.web.domain.vo.DietaryPrescriptionVo;
-import org.dromara.web.domain.vo.MealPeriodVo;
+import org.dromara.web.domain.vo.*;
 import org.dromara.web.mapper.*;
 import org.dromara.web.service.ReportService;
 import org.springframework.stereotype.Service;
@@ -46,6 +48,16 @@ public class ReportServiceImpl implements ReportService {
     private final SysDeptMapper sysDeptMapper;
     private final SysUserMapper sysUserMapper;
     private final SettlementMapper settlementMapper;
+    private final SysDictDataMapper sysDictDataMapper;
+    private final ChargeRecordMapper chargeRecordMapper;
+    private final EnteralNutritionMapper enteralNutritionMapper;
+    private final ProductNutritionMapper productNutritionMapper;
+    private final ProductCategoryMapper productCategoryMapper;
+    private final ProductManufacturerMapper productManufacturerMapper;
+    private final ProductSupplierMapper productSupplierMapper;
+    private final EnteralNutritionConsumableMapper enteralNutritionConsumableMapper;
+    private final SuppliesManageMapper suppliesManageMapper;
+    private final SuppliesCategoryMapper suppliesCategoryMapper;
 
     @Override
     public R getNutritionalQualityControl(Timestamp start, Timestamp end) {
@@ -67,93 +79,192 @@ public class ReportServiceImpl implements ReportService {
 //            pageQuery.getPageNum(),
 //            pageQuery.getPageSize()
 //        );
+
+        Map<Long, String> patientMap = new HashMap<>();
+        Map<Long, String> deptMap = new HashMap<>();
+        Map<Long, String> userMap = new HashMap<>();
         List<Long> ids = new ArrayList<>();
+        Map<String, String> payStatusMap = new HashMap<>();
+
+        treatmentUserMapper.selectList().forEach(e -> patientMap.put(e.getId(), e.getTreatName()));
+        sysDeptMapper.selectList().forEach(e -> deptMap.put(e.getDeptId(), e.getDeptName()));
+        sysUserMapper.selectList().forEach(e -> userMap.put(e.getUserId(), e.getName()));
         treatmentUserMapper.selectList(
             Wrappers.lambdaQuery(TreatmentUser.class).like(TreatmentUser::getTreatName, bo.getName())
         ).forEach(e -> ids.add(e.getId()));
+        sysDictDataMapper.selectDictDataByType("payment_status").forEach(e -> payStatusMap.put(e.getDictValue(), e.getDictLabel()));
 
-        Page<HospitalMealPlan> page = hospitalMealPlanMapper.selectPage(
-            pageQuery.build(),
-            Wrappers.lambdaQuery(HospitalMealPlan.class)
-                .ge(HospitalMealPlan::getCreateTime, bo.getCalculationDateEarliest())
-                .le(HospitalMealPlan::getCreateTime, bo.getCalculationDateLatest())
-                .in(HospitalMealPlan::getPatientId, ids)
-                .eq(HospitalMealPlan::getDeptId, bo.getPatientDepartmentId())
-                .eq(HospitalMealPlan::getCreateDept, bo.getDoctorDepartmentId())
-                .isNotNull(HospitalMealPlan::getSettlementId)
-        );
+        if (bo.getDietaryType() == 0) {
 
-        Map<Long, String> deptMap = new HashMap<>();
-        Map<Long, String> userMap = new HashMap<>();
-        Map<Long, String> patientMap = new HashMap<>();
-        Map<Long, String> settlementMap = new HashMap<>();
-        // 食谱 ID    食谱名称
-        Map<Long, String> recipeMap = new HashMap<>();
-        // 食谱 ID    所需食材 ID
-        Map<Long, List<Long>> recipeToIngredientMap = new HashMap<>();
-        // 食材 ID   食材名称
-        Map<Long, String> ingredientMap = new HashMap<>();
+            Page<HospitalMealPlan> page = hospitalMealPlanMapper.selectPage(
+                pageQuery.build(),
+                Wrappers.lambdaQuery(HospitalMealPlan.class)
+                    .ge(bo.getCalculationDateEarliest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateEarliest())
+                    .le(bo.getCalculationDateLatest() != null, HospitalMealPlan::getCreateTime, bo.getCalculationDateLatest())
+                    .in(!ids.isEmpty(), HospitalMealPlan::getPatientId, ids)
+                    .eq(bo.getPatientDepartmentId() != null, HospitalMealPlan::getDeptId, bo.getPatientDepartmentId())
+                    .eq(bo.getDoctorDepartmentId() != null, HospitalMealPlan::getCreateDept, bo.getDoctorDepartmentId())
+                    .isNotNull(HospitalMealPlan::getSettlementId)
+            );
 
-        sysDeptMapper.selectList().forEach(e -> deptMap.put(e.getDeptId(), e.getDeptName()));
-        sysUserMapper.selectList().forEach(e -> userMap.put(e.getUserId(), e.getName()));
-        treatmentUserMapper.selectList().forEach(e -> patientMap.put(e.getId(), e.getTreatName()));
-        settlementMapper.selectList().forEach(e -> settlementMap.put(e.getId(), e.getPaymentStatus()));
-        sysRecipeMapper.selectList().forEach(e -> recipeMap.put(e.getRecipeId(), e.getName()));
-        sysRecipeFoodIngredientMapper.selectList().forEach(e -> {
-            if (recipeToIngredientMap.containsKey(e.getRecipeId())) {
-                recipeToIngredientMap.get(e.getRecipeId()).add(e.getFoodIngredientId());
-            } else {
-                recipeToIngredientMap.put(e.getRecipeId(), List.of(e.getFoodIngredientId()));
-            }
-        });
-        sysFoodIngredientMapper.selectList().forEach(e -> ingredientMap.put(e.getFoodIngredientId(), e.getName()));
+            Map<Long, String> settlementMap = new HashMap<>();
+            // 食谱 ID    食谱名称
+            Map<Long, String> recipeMap = new HashMap<>();
+            // 食谱 ID    所需食材 ID
+            Map<Long, List<Long>> recipeToIngredientMap = new HashMap<>();
+            // 食材 ID   食材名称
+            Map<Long, String> ingredientMap = new HashMap<>();
 
-        Map<String, List<String>> foodMap = new HashMap<>();
-        recipeToIngredientMap.forEach((k, v) -> {
-            List<String> list = new ArrayList<>();
-            v.forEach( e -> list.add(ingredientMap.get(e)));
-            foodMap.put(recipeMap.get(k), list);
-        });
 
-        return TableDataInfo.build(page.convert(e -> {
-            DietaryPrescriptionVo vo = new DietaryPrescriptionVo();
-            vo.setId(e.getId());
-            vo.setTradeDate(new Date());
-            vo.setCalculationDate(e.getCreateTime());
-            vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
-            vo.setCalculationDoctorDepartment(deptMap.get(e.getDeptId()));
-            vo.setCalculationDoctor(userMap.get(e.getCreateBy()));
-            vo.setPatientDepartment(deptMap.get(e.getDeptId()));
-            vo.setPatientName(patientMap.get(e.getPatientId()));
-            vo.setPayStatus(settlementMap.get(e.getSettlementId()));
-
-            List<CookbookVo> breakfast = new ArrayList<>();
-            List<CookbookVo> breakfastExtra = new ArrayList<>();
-            List<CookbookVo> lunch = new ArrayList<>();
-            List<CookbookVo> lunchExtra = new ArrayList<>();
-            List<CookbookVo> dinner = new ArrayList<>();
-            List<CookbookVo> dinnerExtra = new ArrayList<>();
-            hospitalMealRecipeMapper.selectList(
-                Wrappers.lambdaQuery(HospitalMealRecipe.class).eq(HospitalMealRecipe::getPlanId, e.getId())
-            ).forEach(t -> {
-                switch (t.getMealTime()) {
-                    case "早餐" -> breakfast.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
-                    case "早中" -> breakfastExtra.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
-                    case "中餐" -> lunch.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
-                    case "中加" -> lunchExtra.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
-                    case "晚餐" -> dinner.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
-                    case "晚加" -> dinnerExtra.add(new CookbookVo(t.getFoodName(), foodMap.get(t.getFoodName())));
+            settlementMapper.selectList().forEach(e -> settlementMap.put(e.getId(), e.getPaymentStatus()));
+            sysRecipeMapper.selectList().forEach(e -> recipeMap.put(e.getRecipeId(), e.getName()));
+            sysRecipeFoodIngredientMapper.selectList().forEach(e -> {
+                if (recipeToIngredientMap.containsKey(e.getRecipeId())) {
+                    recipeToIngredientMap.get(e.getRecipeId()).add(e.getFoodIngredientId());
+                } else {
+                    recipeToIngredientMap.put(e.getRecipeId(), List.of(e.getFoodIngredientId()));
                 }
             });
+            sysFoodIngredientMapper.selectList().forEach(e -> ingredientMap.put(e.getFoodIngredientId(), e.getName()));
 
-            vo.setBreakfast(breakfast);
-            vo.setBreakfastExtra(breakfastExtra);
-            vo.setLunch(lunch);
-            vo.setLunchExtra(lunchExtra);
-            vo.setDinner(dinner);
-            vo.setDinnerExtra(dinnerExtra);
-            return vo;
-        }));
+            Map<String, List<String>> foodMap = new HashMap<>();
+            recipeToIngredientMap.forEach((k, v) -> {
+                List<String> list = new ArrayList<>();
+                v.forEach( e -> list.add(ingredientMap.get(e)));
+                foodMap.put(recipeMap.get(k), list);
+            });
+
+            return TableDataInfo.build(page.convert(e -> {
+                InHospitalDietaryPrescriptionVo vo = new InHospitalDietaryPrescriptionVo();
+                vo.setId(e.getId());
+                vo.setTradeDate(new Date());
+                vo.setCalculationDate(e.getCreateTime());
+                vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
+                vo.setCalculationDoctorDepartment(deptMap.get(e.getDeptId()));
+                vo.setCalculationDoctor(userMap.get(e.getCreateBy()));
+                vo.setPatientDepartment(deptMap.get(e.getDeptId()));
+                vo.setPatientName(patientMap.get(e.getPatientId()));
+                vo.setPayStatus(payStatusMap.get(settlementMap.get(e.getSettlementId())));
+
+                List<CookbookVo> breakfast = new ArrayList<>();
+                List<CookbookVo> breakfastExtra = new ArrayList<>();
+                List<CookbookVo> lunch = new ArrayList<>();
+                List<CookbookVo> lunchExtra = new ArrayList<>();
+                List<CookbookVo> dinner = new ArrayList<>();
+                List<CookbookVo> dinnerExtra = new ArrayList<>();
+                hospitalMealRecipeMapper.selectList(
+                    Wrappers.lambdaQuery(HospitalMealRecipe.class).eq(HospitalMealRecipe::getPlanId, e.getId())
+                ).forEach(t -> {
+                    switch (t.getMealTime()) {
+                        case "早餐" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            breakfast.add(cookbook);
+                        }
+                        case "早中" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            breakfastExtra.add(cookbook);
+                        }
+                        case "中餐" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            lunch.add(cookbook);
+                        }
+                        case "中加" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            lunchExtra.add(cookbook);
+                        }
+                        case "晚餐" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            dinner.add(cookbook);
+                        }
+                        case "晚加" -> {
+                            CookbookVo cookbook = new CookbookVo();
+                            cookbook.setCookbookName(t.getFoodName());
+                            cookbook.setTotal(t.getFoodWeight());
+                            cookbook.setPrice(t.getPrice());
+                            cookbook.setCount(t.getAmount());
+                            cookbook.setRefundCount(0L);
+                            cookbook.setRefundAmount(new BigDecimal("0"));
+                            cookbook.setRefundDeductionAmount(new BigDecimal("0"));
+                            cookbook.setIngredients(foodMap.get(t.getFoodName()));
+                            dinnerExtra.add(cookbook);
+                        }
+                    }
+                });
+
+                vo.setBreakfast(breakfast);
+                vo.setBreakfastExtra(breakfastExtra);
+                vo.setLunch(lunch);
+                vo.setLunchExtra(lunchExtra);
+                vo.setDinner(dinner);
+                vo.setDinnerExtra(dinnerExtra);
+                vo.setDietaryExpenses(e.getTotalPrice());
+                return vo;
+            }));
+        } else {
+
+            Page<DailyMealPlan> page = dailyMealPlanMapper.selectPage(
+                pageQuery.build(),
+                Wrappers.lambdaQuery(DailyMealPlan.class)
+                    .ge(bo.getCalculationDateEarliest() != null, DailyMealPlan::getCreateTime, bo.getCalculationDateEarliest())
+                    .le(bo.getCalculationDateLatest() != null, DailyMealPlan::getCreateTime, bo.getCalculationDateLatest())
+                    .eq(bo.getPatientDepartmentId() != null, DailyMealPlan::getDeptId, bo.getPatientDepartmentId())
+                    .eq(bo.getDoctorDepartmentId() != null, DailyMealPlan::getCreateDept, bo.getDoctorDepartmentId())
+                    .in(!ids.isEmpty(), DailyMealPlan::getPatientId, ids)
+            );
+
+            return TableDataInfo.build(page.convert(e -> {
+                OtherDietaryPrescriptionVo vo = new OtherDietaryPrescriptionVo();
+                vo.setId(e.getId());
+                vo.setCreateTime(e.getCreateTime());
+                vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
+                vo.setDietaryType("日常膳食");
+                vo.setDoctorDepartment(deptMap.get(e.getCreateDept()));
+                vo.setDoctor(userMap.get(e.getCreateBy()));
+                vo.setPatientDepartment(deptMap.get(e.getDeptId()));
+                vo.setPatient(patientMap.get(e.getPatientId()));
+                return vo;
+            }));
+        }
     }
 
     @Override
@@ -168,17 +279,243 @@ public class ReportServiceImpl implements ReportService {
 
     @Override
     public TableDataInfo listPageInHospitalBillingReconciliation(InHospitalBillingReconciliationBo bo, PageQuery pageQuery) {
-        return null;
+        Page<ChargeRecord> page = chargeRecordMapper.selectPage(
+            pageQuery.build(),
+            Wrappers.lambdaQuery(ChargeRecord.class)
+                .ge(bo.getTradeDateEarliest() != null, ChargeRecord::getCreateTime, bo.getTradeDateEarliest())
+                .le(bo.getTradeDateLatest() != null, ChargeRecord::getCreateTime, bo.getTradeDateLatest())
+                .eq(bo.getPatientDepartmentId() != null, ChargeRecord::getDoorId, bo.getPatientDepartmentId())
+                .eq(bo.getDepartmentId() != null, ChargeRecord::getCreateDept, bo.getDepartmentId())
+                .eq(bo.getConsultationType() != null, ChargeRecord::getVisitType, bo.getConsultationType())
+                .eq(bo.getPayStatus() != null, ChargeRecord::getPaymentStatus, bo.getPayStatus())
+                .eq(bo.getPayMethod() != null, ChargeRecord::getPaymentMethod, bo.getPayMethod())
+        );
+
+        Map<Long, String> departmentMap = new HashMap<>();
+        Map<Long, String> doctorMap = new HashMap<>();
+        Map<Long, String> patientMap = new HashMap<>();
+        Map<String, String> payStatusMap = new HashMap<>();
+        Map<String, String> payMethodMap = new HashMap<>();
+        Map<String, String> feeTypeMap = new HashMap<>();
+
+        sysDeptMapper.selectList().forEach(e -> departmentMap.put(e.getDeptId(), e.getDeptName()));
+        sysUserMapper.selectList().forEach(e -> doctorMap.put(e.getUserId(), e.getName()));
+        treatmentUserMapper.selectList().forEach(e -> patientMap.put(e.getId(), e.getTreatName()));
+        sysDictDataMapper.selectDictDataByType("payment_status").forEach(e -> payStatusMap.put(e.getDictValue(), e.getDictLabel()));
+        sysDictDataMapper.selectDictDataByType("charge_way").forEach(e -> payMethodMap.put(e.getDictValue(), e.getDictLabel()));
+        sysDictDataMapper.selectDictDataByType("fee_type").forEach(e -> feeTypeMap.put(e.getDictValue(), e.getDictLabel()));
+
+        return TableDataInfo.build(page.convert(e -> {
+            InHospitalBillingReconciliationVo vo = new InHospitalBillingReconciliationVo();
+            vo.setCreateTime(e.getCreateTime());
+            vo.setPatientDepartment(departmentMap.get(e.getDoorId()));
+            vo.setPatient(patientMap.get(e.getPatientId()));
+            vo.setCardId(e.getIdCard());
+            vo.setConsultationType(Objects.equals(e.getVisitType(), "0") ? "门诊" : "住院");
+            vo.setMedicalId(e.getPatientNo());
+            vo.setOrderType(feeTypeMap.get(e.getChargeType()));
+            vo.setDoctor(doctorMap.get(e.getCreateBy()));
+            vo.setDepartment(departmentMap.get(e.getCreateDept()));
+            vo.setAmount(e.getReceivableAmount());
+            vo.setPayMethod(payMethodMap.get(e.getPaymentMethod()));
+            vo.setActioner(doctorMap.get(e.getCreateBy()));
+            vo.setTransactionId(settlementMapper.selectById(e.getSettlementId()).getTransactionId());
+            return vo;
+        }));
     }
 
     @Override
-    public TableDataInfo listCost(CostBo bo, PageQuery pageQuery) {
-        return null;
+    public R listCost(CostBo bo) {
+        if (bo.getType() == 1) {
+
+            List<FoodVo> voList = new ArrayList<>();
+
+            Map<Long, List<Long>> recipeToIngredientMap = new HashMap<>();
+            sysRecipeFoodIngredientMapper.selectList().forEach(e -> {
+                if (recipeToIngredientMap.containsKey(e.getRecipeId())) {
+                    recipeToIngredientMap.get(e.getRecipeId()).add(e.getFoodIngredientId());
+                } else {
+                    recipeToIngredientMap.put(e.getRecipeId(), List.of(e.getFoodIngredientId()));
+                }
+            });
+            List<SysRecipe> recipes = sysRecipeMapper.selectList();
+            List<SysFoodIngredient> ingredients = sysFoodIngredientMapper.selectList();
+            List<HospitalMealRecipe> list = hospitalMealRecipeMapper.selectList();
+
+            for (SysRecipe recipe : recipes) {
+                int count = 0;
+                for (HospitalMealRecipe element : list) if (Objects.equals(element.getFoodId(), recipe.getRecipeId())) count++;
+
+                if (count != 0) {
+                    FoodVo foodVo = new FoodVo();
+                    foodVo.setFoodName(recipe.getName());
+
+                    BigDecimal cost = new BigDecimal("0");
+
+                    List<String> ingredientNames = new ArrayList<>();
+                    for (Long ingredientId : recipeToIngredientMap.get(recipe.getRecipeId()))
+                        for (SysFoodIngredient e : ingredients) {
+                            if (Objects.equals(ingredientId, e.getFoodIngredientId())) ingredientNames.add(e.getName());
+                            cost = cost.add(e.getPurchasePrice());
+                        }
+
+                    foodVo.setIngredients(ingredientNames);
+                    foodVo.setAccount(count);
+                    foodVo.setCost(cost);
+                    foodVo.setAmount(recipe.getPrice());
+                    voList.add(foodVo);
+                }
+
+            }
+
+            return R.ok(voList);
+        } else {
+            List<CostPrescriptionVo> result = new ArrayList<>();
+
+            List<EnteralNutrition> enteralNutritionList = enteralNutritionMapper.selectList(
+                Wrappers.lambdaQuery(EnteralNutrition.class)
+                    .eq(EnteralNutrition::getPrescriptionType, String.valueOf(bo.getType()))
+            );
+            List<ProductNutrition> productNutritionList = productNutritionMapper.selectList();
+            List<SysDept> deptList = sysDeptMapper.selectList();
+
+            for (SysDept dept : deptList) {
+                int deptCount = 0;
+                Long deptId = dept.getDeptId();
+                List<ProductVo> productList = new ArrayList<>();
+                for (ProductNutrition productNutrition : productNutritionList) {
+
+                    if (Objects.equals(productNutrition.getCreateDept(), deptId)) deptCount++;
+
+                    int count = 0;
+                    for (EnteralNutrition enteralNutrition : enteralNutritionList) {
+
+                        if (!Objects.equals(enteralNutrition.getNutritionProductId(), productNutrition.getId())) continue;
+                        if (Objects.isNull(enteralNutrition.getQuantity())) continue;
+
+                        count += enteralNutrition.getQuantity();
+                    }
+
+                    if (count == 0) continue;
+
+                    ProductVo vo = new ProductVo();
+                    vo.setId(productNutrition.getId());
+                    vo.setName(productNutrition.getProductName());
+                    vo.setSalesQuantity(count);
+                    vo.setSalesCost(productNutrition.getPurchasePrice().multiply(new BigDecimal(count)));
+                    vo.setSalesAmount(productNutrition.getConfigSalePrice().multiply(new BigDecimal(count)));
+                    productList.add(vo);
+                }
+
+                if (deptCount == 0) continue;
+
+                CostPrescriptionVo vo = new CostPrescriptionVo();
+                vo.setId(deptId);
+                vo.setName(dept.getDeptName());
+                vo.setProductList(productList);
+                result.add(vo);
+            }
+
+            CostPrescriptionVo vo = new CostPrescriptionVo();
+            vo.setId(null);
+            vo.setName("合计");
+            List<ProductVo> productVoList = new ArrayList<>();
+
+            for (CostPrescriptionVo costPrescriptionVo : result) {
+                for (ProductVo prescriptionVo : costPrescriptionVo.getProductList()) {
+
+                    int count = productVoList.stream()
+                        .filter(e -> Objects.equals(e.getId(), prescriptionVo.getId()))
+                        .toList().size();
+
+                    if (count == 0)
+                        productVoList.add(prescriptionVo);
+                    else
+                        productVoList = productVoList.stream()
+                            .filter(e -> Objects.equals(e.getId(), prescriptionVo.getId()))
+                            .peek(e -> {
+                                e.setSalesQuantity(e.getSalesQuantity() + prescriptionVo.getSalesQuantity());
+                                e.setSalesCost(e.getSalesCost().add(prescriptionVo.getSalesCost()));
+                                e.setSalesAmount(e.getSalesAmount().add(prescriptionVo.getSalesAmount()));
+                            }).toList();
+                }
+            }
+
+            vo.setProductList(productVoList);
+            result.add(vo);
+
+            return R.ok(result);
+        }
     }
 
     @Override
     public TableDataInfo listPageProgressNote(ProgressNoteBo bo, PageQuery pageQuery) {
-        return null;
+
+        List<Long> ids = new ArrayList<>();
+        treatmentUserMapper.selectList(
+            Wrappers.lambdaQuery(TreatmentUser.class).like(TreatmentUser::getTreatName, bo.getPatient())
+        ).forEach(e -> ids.add(e.getId()));
+
+        Map<Long, String> departmentMap = new HashMap<>();
+        Map<Long, String> doctorMap = new HashMap<>();
+        Map<Long, String> patientMap = new HashMap<>();
+        Map<String, String> payStatusMap = new HashMap<>();
+        Map<String, String> payMethodMap = new HashMap<>();
+        Map<String, String> feeTypeMap = new HashMap<>();
+
+        sysDeptMapper.selectList().forEach(e -> departmentMap.put(e.getDeptId(), e.getDeptName()));
+        sysUserMapper.selectList().forEach(e -> doctorMap.put(e.getUserId(), e.getName()));
+        treatmentUserMapper.selectList().forEach(e -> patientMap.put(e.getId(), e.getTreatName()));
+        sysDictDataMapper.selectDictDataByType("payment_status").forEach(e -> payStatusMap.put(e.getDictValue(), e.getDictLabel()));
+        sysDictDataMapper.selectDictDataByType("charge_way").forEach(e -> payMethodMap.put(e.getDictValue(), e.getDictLabel()));
+        sysDictDataMapper.selectDictDataByType("fee_type").forEach(e -> feeTypeMap.put(e.getDictValue(), e.getDictLabel()));
+
+        List<ChargeRecord> records = chargeRecordMapper.selectList(Wrappers.lambdaQuery(ChargeRecord.class).in(!ids.isEmpty(), ChargeRecord::getPatientId, ids));
+
+        Page<TreatmentUser> page = treatmentUserMapper.selectPage(
+            pageQuery.build(),
+            Wrappers.lambdaQuery(TreatmentUser.class)
+                .ge(bo.getCreateTimeEarliest() != null, TreatmentUser::getCreateTime, bo.getCreateTimeEarliest())
+                .le(bo.getCreateTimeLatest() != null, TreatmentUser::getCreateTime, bo.getCreateTimeLatest())
+                .eq(bo.getPatientDepartmentId() != null, TreatmentUser::getDoorId, bo.getPatientDepartmentId())
+                .eq(!ids.isEmpty(), TreatmentUser::getId, ids)
+        );
+
+        return TableDataInfo.build(page.convert(e -> {
+            ProgressNoteVo vo = new ProgressNoteVo();
+            vo.setPatientName(e.getTreatName());
+            vo.setHeight(e.getHeight());
+            vo.setWeight(e.getWeight());
+            vo.setBmi(e.getBmi());
+            vo.setIdCard(e.getIdCard());
+            vo.setConsultationType(Objects.equals(e.getType(), "0") ? "门诊" : "住院");
+            vo.setPatientDepartment(departmentMap.get(e.getDoorId()));
+            vo.setMedicalId(e.getTreatNum());
+            vo.setCreateTime(e.getCreateTime());
+
+            int screeningCount = 0, assessmentCount = 0;
+            BigDecimal amount = new BigDecimal("0");
+            for (ChargeRecord record : records) {
+                if (!Objects.equals(record.getPatientId(), e.getId()) || Objects.isNull(record.getFundsReceived())) continue;
+                if (Objects.equals(record.getChargeType(), "0")) {
+                    screeningCount++;
+                    amount = amount.add(record.getFundsReceived());
+                }
+                if (Objects.equals(record.getChargeType(), "1")) {
+                    assessmentCount++;
+                    amount = amount.add(record.getFundsReceived());
+                }
+            }
+            vo.setNutritionScreeningCount(screeningCount);
+            vo.setNutritionAssessmentCount(assessmentCount);
+
+            vo.setNutritionDiagnosesCount(0);
+            vo.setNutritionInterventionCount(0);
+            vo.setNutritionMealCount(0);
+            vo.setNutritionEducationCount(0);
+            vo.setAmount(amount);
+            return vo;
+        }));
     }
 
     @Override
@@ -186,4 +523,244 @@ public class ReportServiceImpl implements ReportService {
         return R.ok();
     }
 
+    @Override
+    public TableDataInfo<PrescriptionVo> getEnteralNutrition(EnteralNutritionPrescriptionBo bo, PageQuery pageQuery) {
+
+        Map<Long, String> patientMap = new HashMap<>();
+        Map<Long, String> deptMap = new HashMap<>();
+        Map<Long, String> userMap = new HashMap<>();
+        List<Long> ids = new ArrayList<>();
+        Map<String, String> payStatusMap = new HashMap<>();
+        Map<String, String> consultationMap = new HashMap<>();
+
+        treatmentUserMapper.selectList().forEach(e -> patientMap.put(e.getId(), e.getTreatName()));
+        sysDeptMapper.selectList().forEach(e -> deptMap.put(e.getDeptId(), e.getDeptName()));
+        sysUserMapper.selectList().forEach(e -> userMap.put(e.getUserId(), e.getName()));
+        treatmentUserMapper.selectList().forEach(e -> ids.add(e.getId()));
+        sysDictDataMapper.selectDictDataByType("payment_status").forEach(e -> payStatusMap.put(e.getDictValue(), e.getDictLabel()));
+        sysDictDataMapper.selectDictDataByType("fee_type").forEach(e -> consultationMap.put(e.getDictValue(), e.getDictLabel()));
+        List<ProductNutrition> productNutritionList = productNutritionMapper.selectList();
+
+        List<EnteralNutrition> enteralNutritionList = enteralNutritionMapper.selectList();
+        IPage<Settlement> settlementPage = settlementMapper.selectPage(
+            pageQuery.build(),
+            Wrappers.lambdaQuery(Settlement.class)
+                .ge(bo.getCreateDateEarliest() != null, Settlement::getCreateTime, bo.getCreateDateEarliest())
+                .le(bo.getCreateDateLatest() != null, Settlement::getCreateTime, bo.getCreateDateLatest())
+                .eq(bo.getPatientDepartmentId() != null, Settlement::getDoorId, bo.getPatientDepartmentId())
+                .eq(bo.getDoctorDepartmentId() != null, Settlement::getCreateDept, bo.getDoctorDepartmentId())
+        );
+        List<Long> settlementIds = new ArrayList<>();
+        settlementPage.getRecords().forEach(e -> settlementIds.add(e.getId()));
+        List<ChargeRecord> records = chargeRecordMapper.selectList(
+            Wrappers.lambdaQuery(ChargeRecord.class)
+                .in(!settlementIds.isEmpty(), ChargeRecord::getSettlementId, settlementIds)
+        );
+
+        List<PrescriptionVo> list = new ArrayList<>();
+
+        for (Settlement settlement : settlementPage.getRecords()) {
+            PrescriptionVo vo = new PrescriptionVo();
+            vo.setPrescriptionId(settlement.getId());
+
+            ChargeRecord record = null;
+            for (ChargeRecord element : records)
+                if (Objects.equals(element.getSettlementId(), settlement.getId()))
+                    record = element;
+
+            vo.setTradeTime(Objects.nonNull(record) ? record.getCreateTime() : null);
+            vo.setOpeningDate(settlement.getOrderTime());
+            vo.setPatientVisitTypeName(Objects.equals(settlement.getVisitType(), "0") ? "门诊" : "住院");
+            vo.setPatientName(patientMap.get(settlement.getPatientId()));
+            vo.setModelTypeName(consultationMap.get(settlement.getChargeType()));
+            vo.setDoctorDeptName(deptMap.get(settlement.getCreateDept()));
+            vo.setDoctorUserName(userMap.get(settlement.getCreateBy()));
+            vo.setDoctorWorkNo(null);
+            vo.setPayStatusName(payStatusMap.get(settlement.getPaymentStatus()));
+            vo.setRealPrice(Objects.nonNull(record) ? record.getFundsReceived() : null);
+            vo.setRealRefundPrice(Objects.nonNull(record) ? record.getRefundAmount() : null);
+            vo.setRealLossPrice(new BigDecimal("0"));
+            vo.setPatientDeptName(deptMap.get(settlement.getDoorId()));
+
+            List<PrescriptionDetailVo> detailList = new ArrayList<>();
+
+            for (EnteralNutrition enteralNutrition : enteralNutritionList) {
+                if (!Objects.equals(settlement.getId(), enteralNutrition.getSettlementId())) continue;
+
+                ProductNutrition productNutrition = null;
+                for (ProductNutrition element : productNutritionList)
+                    if (Objects.equals(element.getId(), enteralNutrition.getNutritionProductId()))
+                        productNutrition = element;
+
+                PrescriptionDetailVo detailVo = new PrescriptionDetailVo();
+                detailVo.setName(enteralNutrition.getNutritionProduct());
+                detailVo.setSpecsName(enteralNutrition.getSpecification());
+                detailVo.setUnitDosage(enteralNutrition.getTotalDose());
+                detailVo.setUnitPrice(enteralNutrition.getAmount());
+                detailVo.setProductNo(Objects.nonNull(productNutrition) ? productNutrition.getProductCode() : null);
+                detailVo.setSpecsUnitName(Objects.nonNull(productNutrition) ? productNutrition.getMinUnit() : null);
+                detailVo.setRefundDosage("0");
+                detailVo.setLossDosage("0");
+                detailVo.setGroupNo(Integer.valueOf(enteralNutrition.getGroupNo()));
+                detailVo.setTotalNum(enteralNutrition.getQuantity() != null ? enteralNutrition.getQuantity().intValue() : null);
+                detailVo.setConfigNum(0);
+                detailVo.setConfigRefundNum(0);
+                detailVo.setConfigAmount(Objects.nonNull(productNutrition) ? productNutrition.getConfigSalePrice() : null);
+                detailList.add(detailVo);
+            }
+
+            vo.setDetailList(detailList);
+            list.add(vo);
+        }
+
+//        EnteralNutritionPrescriptionVo vo = new EnteralNutritionPrescriptionVo();
+//        vo.setList(list);
+//        vo.setCount(settlementPage.getSize());
+        IPage<PrescriptionVo> page = new Page<>();
+        page.setPages(settlementPage.getPages());
+        page.setRecords(list);
+        page.setTotal(settlementPage.getTotal());
+        page.setSize(settlementPage.getSize());
+        page.setCurrent(settlementPage.getCurrent());
+
+        return TableDataInfo.build(page);
+    }
+
+    @Override
+    public TableDataInfo<ListProductVo> listProduct(ListProductBo bo, PageQuery pageQuery) {
+
+        Map<Long, String> typeMap = new HashMap<>();
+        Map<Long, String> manufacturerMap = new HashMap<>();
+        Map<Long, String> providerMap = new HashMap<>();
+
+        productManufacturerMapper.selectList().forEach(e -> manufacturerMap.put(e.getId(), e.getName()));
+        productSupplierMapper.selectList().forEach(e -> providerMap.put(e.getId(), e.getName()));
+
+        if (bo.getProductType() == 0) {
+
+            productCategoryMapper.selectList().forEach(e -> typeMap.put(e.getCategoryId(), e.getCategoryName()));
+
+            IPage<ProductNutrition> page = productNutritionMapper.selectPage(
+                pageQuery.build(),
+                Wrappers.lambdaQuery(ProductNutrition.class)
+                    .ge(bo.getTradeDateEarliest() != null, ProductNutrition::getCreateTime, bo.getTradeDateEarliest())
+                    .le(bo.getTradeDateLatest() != null, ProductNutrition::getCreateTime, bo.getTradeDateLatest())
+                    .eq(bo.getManufacturerId() != null, ProductNutrition::getManufacturer, bo.getManufacturerId())
+                    .eq(bo.getProviderId() != null, ProductNutrition::getSupplier, bo.getProviderId())
+                    .like(bo.getProductName() != null, ProductNutrition::getProductName, bo.getProductName())
+            );
+            List<EnteralNutrition> enteralNutritionList = enteralNutritionMapper.selectList();
+
+            return TableDataInfo.build(page.convert(e -> {
+                ListProductVo vo = new ListProductVo();
+                vo.setTradeDate(e.getCreateTime());
+                vo.setHospitalSystemCode(e.getHospitalSystemCode());
+                if (Objects.nonNull(e.getProductCategory())) {
+                    String[] types = e.getProductCategory().split(",");
+                    String productType = "";
+                    for (String type : types) {
+                        Long typeId = Long.valueOf(type);
+                        productType += typeMap.get(typeId) + ",";
+                    }
+                    vo.setProductClassification(productType);
+                }
+
+                vo.setProductType("营养产品");
+                vo.setProductName(e.getProductName());
+                vo.setProductSpecification(e.getProductSpec());
+                vo.setProviderName(Objects.nonNull(e.getSupplier()) ? providerMap.get(Long.valueOf(e.getSupplier())) : null);
+                vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) ? manufacturerMap.get(Long.valueOf(e.getManufacturer())) : null);
+
+                String prePackageUnit = e.getPackageUnit();
+                String configureUnit = e.getMinUnit();
+
+                int prePackageCount = 0, configureCount = 0, longTermCount = 0;
+                for (EnteralNutrition enteralNutrition : enteralNutritionList) {
+                    if (!Objects.equals(e.getId(), enteralNutrition.getNutritionProductId())) continue;
+
+                    switch (enteralNutrition.getPrescriptionType()) {
+                        case "2" -> prePackageCount++;
+                        case "3" -> {
+                            if (enteralNutrition.getUsageDays() <= 90) configureCount++;
+                            else longTermCount++;
+                        }
+                    }
+                }
+
+
+                vo.setPrePackageSalesVolume(prePackageCount + prePackageUnit);
+                vo.setPrePackageSalesAmount(e.getPackagePrice().multiply(new BigDecimal(prePackageCount)));
+                vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0"));
+                vo.setPrePackagePurchaseAmount(new BigDecimal("0"));
+                vo.setConfigureSalesVolume(configureCount + configureUnit);
+                vo.setConfigureSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(configureCount)));
+                vo.setLongTermPrescriptionSalesVolume(longTermCount + configureUnit);
+                vo.setLongTermPrescriptionSalesAmount(e.getConfigSalePrice().multiply(new BigDecimal(longTermCount)));
+                vo.setPrePackageRefundVolume("0" + prePackageUnit);
+                vo.setPrePackageRefundAmount(new BigDecimal("0"));
+                vo.setConfigureRefundVolume("0" + configureUnit);
+                vo.setConfigureRefundAmount(new BigDecimal("0"));
+                vo.setLongTermPrescriptionRefundVolume("0" + configureUnit);
+                vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0"));
+                return vo;
+            }));
+        } else {
+
+            IPage<SuppliesManage> page = suppliesManageMapper.selectPage(
+                pageQuery.build(),
+                Wrappers.lambdaQuery(SuppliesManage.class)
+            );
+            suppliesCategoryMapper.selectList().forEach(e -> typeMap.put(e.getCategoryId(), e.getCategoryName()));
+            List<EnteralNutritionConsumable> enteralNutritionConsumableList = enteralNutritionConsumableMapper.selectList();
+
+            return TableDataInfo.build(page.convert(e -> {
+                ListProductVo vo = new ListProductVo();
+                vo.setTradeDate(e.getCreateTime());
+                vo.setHospitalSystemCode(e.getHospitalSystemCode());
+                vo.setProductType("耗材");
+
+                if (Objects.nonNull(e.getSuppliesCategoryId())) {
+                    String[] classifications = e.getSuppliesCategoryId().split(",");
+                    String productClassification = "";
+                    for (String classification : classifications) {
+                        Long classificationId = Long.valueOf(classification);
+                        productClassification += typeMap.get(classificationId) + ",";
+                    }
+                    vo.setProductClassification(productClassification);
+                }
+
+                vo.setProductName(e.getSuppliesName());
+                vo.setProductSpecification(e.getSuppliesSpec());
+                vo.setProviderName(Objects.nonNull(e.getSupplier()) ? providerMap.get(e.getSupplier()) : null);
+                vo.setManufacturerName(Objects.nonNull(e.getManufacturer()) ? manufacturerMap.get(e.getManufacturer()) : null);
+
+                String prePackageUnit = e.getSuppliesUnit();
+                String configureUnit = e.getSuppliesSpecUnit();
+
+                int configureCount = 0, longTermCount = 0;
+                for (EnteralNutritionConsumable enteralNutritionConsumable : enteralNutritionConsumableList) {
+                    if (Objects.equals(e.getId(), enteralNutritionConsumable.getConsumableId())) continue;
+                    if (enteralNutritionConsumable.getUsageDays() <= 90) configureCount++;
+                    else longTermCount++;
+                }
+
+                vo.setPrePackageSalesVolume("0" + prePackageUnit);
+                vo.setPrePackageSalesAmount(new BigDecimal("0"));
+                vo.setPrePackagePurchaseUnitPrice(new BigDecimal("0"));
+                vo.setPrePackagePurchaseAmount(new BigDecimal("0"));
+                vo.setConfigureSalesVolume(configureCount + configureUnit);
+                vo.setConfigureSalesAmount(e.getSellPrice().multiply(new BigDecimal(configureUnit)));
+                vo.setLongTermPrescriptionSalesVolume(longTermCount + configureUnit);
+                vo.setLongTermPrescriptionSalesAmount(e.getSellPrice().multiply(new BigDecimal(longTermCount)));
+                vo.setPrePackageRefundVolume("0" + prePackageUnit);
+                vo.setPrePackageRefundAmount(new BigDecimal("0"));
+                vo.setConfigureRefundVolume("0" + configureUnit);
+                vo.setConfigureRefundAmount(new BigDecimal("0"));
+                vo.setLongTermPrescriptionRefundVolume("0" + configureUnit);
+                vo.setLongTermPrescriptionRefundAmount(new BigDecimal("0"));
+                return vo;
+            }));
+        }
+    }
+
 }

+ 2 - 2
ruoyi-admin/src/main/java/org/dromara/web/service/impl/SettlementServiceImpl.java

@@ -92,8 +92,8 @@ public class SettlementServiceImpl implements ISettlementService {
 
                     if (productNutrition != null) {
                         BigDecimal price = FeeType.PRE_PACKAGED_PRESCRIPTION.getCode().equals(chargeType)
-                            ? new BigDecimal(productNutrition.getPackagePrice())
-                            : new BigDecimal(productNutrition.getConfigSalePrice());
+                            ? productNutrition.getPackagePrice()
+                            : productNutrition.getConfigSalePrice();
                         nutritionVo.setSalePrice(price);
                     }
                 }

+ 258 - 257
ruoyi-admin/src/main/resources/application-dev.yml

@@ -1,284 +1,285 @@
 --- # 监控中心配置
 spring.boot.admin.client:
-  # 增加客户端开关
-  enabled: false
-  url: http://localhost:9090/admin
-  instance:
-    service-host-type: IP
-    metadata:
-      username: ${spring.boot.admin.client.username}
-      userpassword: ${spring.boot.admin.client.password}
-  username: @monitor.username@
-  password: @monitor.password@
+    # 增加客户端开关
+    enabled: false
+    url: http://localhost:9090/admin
+    instance:
+        service-host-type: IP
+        metadata:
+            username: ${spring.boot.admin.client.username}
+            userpassword: ${spring.boot.admin.client.password}
+    username: @monitor.username@
+    password: @monitor.password@
 
 --- # snail-job 配置
 snail-job:
-  enabled: false
-  # 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
-  group: "ruoyi_group"
-  # SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
-  token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
-  server:
-    host: 127.0.0.1
-    port: 17888
-  # 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
-  namespace: ${spring.profiles.active}
-  # 随主应用端口漂移
-  port: 2${server.port}
-  # 客户端ip指定
-  host:
-  # RPC类型: netty, grpc
-  rpc-type: grpc
+    enabled: false
+    # 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
+    group: "ruoyi_group"
+    # SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
+    token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
+    server:
+        host: 127.0.0.1
+        port: 17888
+    # 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
+    namespace: ${spring.profiles.active}
+    # 随主应用端口漂移
+    port: 2${server.port}
+    # 客户端ip指定
+    host:
+    # RPC类型: netty, grpc
+    rpc-type: grpc
 
 --- # 数据源配置
 spring:
-  datasource:
-    type: com.zaxxer.hikari.HikariDataSource
-    # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
-    dynamic:
-      # 性能分析插件(有性能损耗 不建议生产环境使用)
-      p6spy: true
-      # 设置默认的数据源或者数据源组,默认值即为 master
-      primary: master
-      # 严格模式 匹配不到数据源则报错
-      strict: true
-      datasource:
-        # 主库数据源
-        master:
-          type: ${spring.datasource.type}
-          driverClassName: com.mysql.cj.jdbc.Driver
-          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
-          # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://192.168.1.146:3306/wkx_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-          username: root
-          password: P@ssw0rd
+    datasource:
+        type: com.zaxxer.hikari.HikariDataSource
+        # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
+        dynamic:
+            # 性能分析插件(有性能损耗 不建议生产环境使用)
+            p6spy: true
+            # 设置默认的数据源或者数据源组,默认值即为 master
+            primary: master
+            # 严格模式 匹配不到数据源则报错
+            strict: true
+            datasource:
+                # 主库数据源
+                master:
+                    type: ${spring.datasource.type}
+                    driverClassName: com.mysql.cj.jdbc.Driver
+                    # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
+                    # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
+                    url: jdbc:mysql://192.168.1.146:3306/wkx_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+                    username: root
+                    password: P@ssw0rd
+#                    url: jdbc:mysql://localhost:3306/wkx_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+#                    username: root
+#                    password: 1234
+#                    url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+#                    username: root
+#                    password: 123456
 
+                    # 本地数据库
+            #          url: jdbc:mysql://localhost:3306/wkx_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+            #          username: root
+            #          password: 1234
 
-#          url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-#          username: root
-#          password: 123456
-
-          # 本地数据库
-#          url: jdbc:mysql://localhost:3306/wkx_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-#          username: root
-#          password: 1234
-
-#        # 从库数据源
-#        slave:
-#          lazy: true
-#          type: ${spring.datasource.type}
-#          driverClassName: com.mysql.cj.jdbc.Driver
-#          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-#          username:
-#          password:
-#        oracle:
-#          type: ${spring.datasource.type}
-#          driverClassName: oracle.jdbc.OracleDriver
-#          url: jdbc:oracle:thin:@//localhost:1521/XE
-#          username: ROOT
-#          password: root
-#        postgres:
-#          type: ${spring.datasource.type}
-#          driverClassName: org.postgresql.Driver
-#          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
-#          username: root
-#          password: root
-#        sqlserver:
-#          type: ${spring.datasource.type}
-#          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
-#          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
-#          username: SA
-#          password: root
-      hikari:
-        # 最大连接池数量
-        maxPoolSize: 20
-        # 最小空闲线程数量
-        minIdle: 10
-        # 配置获取连接等待超时的时间
-        connectionTimeout: 30000
-        # 校验超时时间
-        validationTimeout: 5000
-        # 空闲连接存活最大时间,默认10分钟
-        idleTimeout: 600000
-        # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
-        maxLifetime: 1800000
-        # 多久检查一次连接的活性
-        keepaliveTime: 30000
+            #        # 从库数据源
+            #        slave:
+            #          lazy: true
+            #          type: ${spring.datasource.type}
+            #          driverClassName: com.mysql.cj.jdbc.Driver
+            #          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+            #          username:
+            #          password:
+            #        oracle:
+            #          type: ${spring.datasource.type}
+            #          driverClassName: oracle.jdbc.OracleDriver
+            #          url: jdbc:oracle:thin:@//localhost:1521/XE
+            #          username: ROOT
+            #          password: root
+            #        postgres:
+            #          type: ${spring.datasource.type}
+            #          driverClassName: org.postgresql.Driver
+            #          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+            #          username: root
+            #          password: root
+            #        sqlserver:
+            #          type: ${spring.datasource.type}
+            #          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+            #          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
+            #          username: SA
+            #          password: root
+            hikari:
+                # 最大连接池数量
+                maxPoolSize: 20
+                # 最小空闲线程数量
+                minIdle: 10
+                # 配置获取连接等待超时的时间
+                connectionTimeout: 30000
+                # 校验超时时间
+                validationTimeout: 5000
+                # 空闲连接存活最大时间,默认10分钟
+                idleTimeout: 600000
+                # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
+                maxLifetime: 1800000
+                # 多久检查一次连接的活性
+                keepaliveTime: 30000
 
 --- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
 spring.data:
-  redis:
-    # 地址
-    host: 192.168.1.146
-#    host: localhost
-    # 端口,默认为6379
-    port: 6379
-    # 数据库索引
-    database: 14
-    # redis 密码必须配置
-#    password: ruoyi123
-    # 连接超时时间
-    timeout: 10s
-    # 是否开启ssl
-    ssl.enabled: false
+    redis:
+        # 地址
+        host: 192.168.1.146
+#        host: localhost
+        # 端口,默认为6379
+        port: 6379
+        # 数据库索引
+        database: 14
+        # redis 密码必须配置
+        #    password: ruoyi123
+        # 连接超时时间
+        timeout: 10s
+        # 是否开启ssl
+        ssl.enabled: false
 
 # redisson 配置
 redisson:
-  # redis key前缀
-  keyPrefix:
-  # 线程池数量
-  threads: 4
-  # Netty线程池数量
-  nettyThreads: 8
-  # 单节点配置
-  singleServerConfig:
-    # 客户端名称 不能用中文
-    clientName: wkx-his
-    # 最小空闲连接数
-    connectionMinimumIdleSize: 8
-    # 连接池大小
-    connectionPoolSize: 32
-    # 连接空闲超时,单位:毫秒
-    idleConnectionTimeout: 10000
-    # 命令等待超时,单位:毫秒
-    timeout: 3000
-    # 发布和订阅连接池大小
-    subscriptionConnectionPoolSize: 50
+    # redis key前缀
+    keyPrefix:
+    # 线程池数量
+    threads: 4
+    # Netty线程池数量
+    nettyThreads: 8
+    # 单节点配置
+    singleServerConfig:
+        # 客户端名称 不能用中文
+        clientName: wkx-his
+        # 最小空闲连接数
+        connectionMinimumIdleSize: 8
+        # 连接池大小
+        connectionPoolSize: 32
+        # 连接空闲超时,单位:毫秒
+        idleConnectionTimeout: 10000
+        # 命令等待超时,单位:毫秒
+        timeout: 3000
+        # 发布和订阅连接池大小
+        subscriptionConnectionPoolSize: 50
 
 --- # mail 邮件发送
 mail:
-  enabled: true
-  host: smtp.qq.com
-  port: 465
-  # 是否需要用户名密码验证
-  auth: true
-  # 发送方,遵循RFC-822标准
-  from: 2053999261@qq.com
-  # 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
-  user: 2053999261@qq.com
-  # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
-  pass: iblppzcfoyrgbifg
-  # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
-  starttlsEnable: true
-  # 使用SSL安全连接
-  sslEnable: true
-  # SMTP超时时长,单位毫秒,缺省值不超时
-  timeout: 0
-  # Socket连接超时值,单位毫秒,缺省值不超时
-  connectionTimeout: 0
+    enabled: true
+    host: smtp.qq.com
+    port: 465
+    # 是否需要用户名密码验证
+    auth: true
+    # 发送方,遵循RFC-822标准
+    from: 2053999261@qq.com
+    # 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
+    user: 2053999261@qq.com
+    # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
+    pass: iblppzcfoyrgbifg
+    # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
+    starttlsEnable: true
+    # 使用SSL安全连接
+    sslEnable: true
+    # SMTP超时时长,单位毫秒,缺省值不超时
+    timeout: 0
+    # Socket连接超时值,单位毫秒,缺省值不超时
+    connectionTimeout: 0
 
 --- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
 # https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
 sms:
-  # 配置源类型用于标定配置来源(interface,yaml)
-  config-type: yaml
-  # 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
-  restricted: true
-  # 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
-  minute-max: 1
-  # 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
-  account-max: 30
-  # 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
-  blends:
-    # 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
-    # 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
-    config1:
-      # 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
-      supplier: alibaba
-      # 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
-      access-key-id: 您的accessKey
-      # 称为accessSecret有些称之为apiSecret
-      access-key-secret: 您的accessKeySecret
-      signature: 您的短信签名
-      sdk-app-id: 您的sdkAppId
-    config2:
-      # 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
-      supplier: tencent
-      access-key-id: 您的accessKey
-      access-key-secret: 您的accessKeySecret
-      signature: 您的短信签名
-      sdk-app-id: 您的sdkAppId
+    # 配置源类型用于标定配置来源(interface,yaml)
+    config-type: yaml
+    # 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
+    restricted: true
+    # 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
+    minute-max: 1
+    # 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
+    account-max: 30
+    # 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
+    blends:
+        # 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
+        # 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
+        config1:
+            # 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
+            supplier: alibaba
+            # 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
+            access-key-id: 您的accessKey
+            # 称为accessSecret有些称之为apiSecret
+            access-key-secret: 您的accessKeySecret
+            signature: 您的短信签名
+            sdk-app-id: 您的sdkAppId
+        config2:
+            # 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
+            supplier: tencent
+            access-key-id: 您的accessKey
+            access-key-secret: 您的accessKeySecret
+            signature: 您的短信签名
+            sdk-app-id: 您的sdkAppId
 
 
 --- # 三方授权
 justauth:
-  # 前端外网访问地址
-  address: http://localhost:80
-  type:
-    maxkey:
-      # maxkey 服务器地址
-      # 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
-      server-url: http://sso.maxkey.top
-      client-id: 876892492581044224
-      client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
-      redirect-uri: ${justauth.address}/social-callback?source=maxkey
-    topiam:
-      # topiam 服务器地址
-      server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
-      client-id: 449c4*********937************759
-      client-secret: ac7***********1e0************28d
-      redirect-uri: ${justauth.address}/social-callback?source=topiam
-      scopes: [openid, email, phone, profile]
-    qq:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=qq
-      union-id: false
-    weibo:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=weibo
-    gitee:
-      client-id: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98
-      client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac
-      redirect-uri: ${justauth.address}/social-callback?source=gitee
-    dingtalk:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=dingtalk
-    baidu:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=baidu
-    csdn:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=csdn
-    coding:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=coding
-      coding-group-name: xx
-    oschina:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=oschina
-    alipay_wallet:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
-      alipay-public-key: MIIB**************DAQAB
-    wechat_open:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=wechat_open
-    wechat_mp:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
-    wechat_enterprise:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
-      agent-id: 1000002
-    gitlab:
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=gitlab
-    gitea:
-      # 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
-      # gitea 服务器地址
-      server-url: https://demo.gitea.com
-      client-id: 10**********6
-      client-secret: 1f7d08**********5b7**********29e
-      redirect-uri: ${justauth.address}/social-callback?source=gitea
+    # 前端外网访问地址
+    address: http://localhost:80
+    type:
+        maxkey:
+            # maxkey 服务器地址
+            # 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
+            server-url: http://sso.maxkey.top
+            client-id: 876892492581044224
+            client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
+            redirect-uri: ${justauth.address}/social-callback?source=maxkey
+        topiam:
+            # topiam 服务器地址
+            server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
+            client-id: 449c4*********937************759
+            client-secret: ac7***********1e0************28d
+            redirect-uri: ${justauth.address}/social-callback?source=topiam
+            scopes: [ openid, email, phone, profile ]
+        qq:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=qq
+            union-id: false
+        weibo:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=weibo
+        gitee:
+            client-id: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98
+            client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac
+            redirect-uri: ${justauth.address}/social-callback?source=gitee
+        dingtalk:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=dingtalk
+        baidu:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=baidu
+        csdn:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=csdn
+        coding:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=coding
+            coding-group-name: xx
+        oschina:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=oschina
+        alipay_wallet:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
+            alipay-public-key: MIIB**************DAQAB
+        wechat_open:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=wechat_open
+        wechat_mp:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
+        wechat_enterprise:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
+            agent-id: 1000002
+        gitlab:
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=gitlab
+        gitea:
+            # 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
+            # gitea 服务器地址
+            server-url: https://demo.gitea.com
+            client-id: 10**********6
+            client-secret: 1f7d08**********5b7**********29e
+            redirect-uri: ${justauth.address}/social-callback?source=gitea

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -22,7 +22,7 @@ server:
 
 captcha:
   # 是否启用验证码校验
-  enable: true
+  enable: false
   # 验证码类型 math 数组计算 char 字符验证
   type: MATH
   # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰

+ 2 - 0
script/sql/biz/update.sql

@@ -24,3 +24,5 @@ ALTER TABLE `invoice_setting` ADD COLUMN `drawer_type` tinyint(1) COMMENT '开
 ALTER TABLE `charge_record` ADD COLUMN `whether_invoice` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已开票(0 否; 1 是)';
 ALTER TABLE `consult_patient` ADD COLUMN `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '诊断状态(0 会诊中; 1 已结束)';
 ALTER TABLE `consult_patient` MODIFY COLUMN `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '诊断状态(0 待会诊; 1 会诊中; 2 已结束)';
+ALTER TABLE `settlement` ADD COLUMN `transaction_id` varchar(32) COMMENT '交易单号';
+ALTER TABLE `invoice_record` MODIFY COLUMN `amount` decimal(10, 2) COMMENT '开票金额';