Quellcode durchsuchen

新增
1、新增预约配置模块
2、自杀风险评估分页接口增加楼层过滤
3、攻击风险评估分页接口增加楼层过滤
4、防文娱活动意外分页接口增加楼层过滤
5、简易精神状态量表分页接口增加楼层过滤
6、感知觉与沟通评估分页接口增加楼层过滤
7、心理社交情况分页接口增加楼层过滤
8、抑郁自评量表分页接口增加楼层过滤
9、焦虑自评量表分页接口增加楼层过滤

liangwenxuan vor 1 Monat
Ursprung
Commit
a953e78072
36 geänderte Dateien mit 775 neuen und 0 gelöschten Zeilen
  1. 34 0
      sql/mysql/appointment_config.sql
  2. 22 0
      sql/mysql/visit_appointment.sql
  3. 53 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/AppointmentConfigController.java
  4. 8 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/ElderlyHealthRecordController.java
  5. 36 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/VisitAppointmentController.java
  6. 28 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/AppointmentConfigRespVO.java
  7. 32 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/AppointmentConfigSaveReqVO.java
  8. 30 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/VisitAppointmentCountRespVO.java
  9. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/assessment/ElderlyAssessmentPageReqVO.java
  10. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessanxiety/ElderlyAssessAnxietyPageReqVO.java
  11. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessattackriskfactors/ElderlyAssessAttackRiskFactorsPageReqVO.java
  12. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessdepression/ElderlyAssessDepressionPageReqVO.java
  13. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessperceptioncommunication/ElderlyAssessPerceptionCommunicationPageReqVO.java
  14. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesspsychologysocial/ElderlyAssessPsychologySocialPageReqVO.java
  15. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesssimplementalstate/ElderlyAssessSimpleMentalStatePageReqVO.java
  16. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesssuiciderisk/ElderlyAssessSuicideRiskPageReqVO.java
  17. 73 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/AppointmentConfigDO.java
  18. 48 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/AppointmentGroupDO.java
  19. 106 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/miniapp/VisitAppointmentDO.java
  20. 9 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/AppointmentConfigMapper.java
  21. 9 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/AppointmentGroupMapper.java
  22. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessAnxietyMapper.java
  23. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessAttackRiskFactorsMapper.java
  24. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessDepressionMapper.java
  25. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessPerceptionCommunicationMapper.java
  26. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessPsychologySocialMapper.java
  27. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessSimpleMentalStateMapper.java
  28. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessSuicideRiskMapper.java
  29. 27 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/miniapp/VisitAppointmentMapper.java
  30. 35 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/AppointmentConfigService.java
  31. 86 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/AppointmentConfigServiceImpl.java
  32. 9 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/ElderlyHealthRecordService.java
  33. 9 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/ElderlyHealthRecordServiceImpl.java
  34. 19 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/miniapp/VisitAppointmentService.java
  35. 61 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/miniapp/VisitAppointmentServiceImpl.java
  36. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/ElderlyAntiEntertainmentMapper.xml

+ 34 - 0
sql/mysql/appointment_config.sql

@@ -0,0 +1,34 @@
+DROP TABLE IF EXISTS `appointment_config`;
+CREATE TABLE `appointment_config`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `enabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT '预约总开关:0-关闭,1-开启',
+  `total_monthly_limit` int(11) NULL DEFAULT NULL COMMENT '总名额-每月限制(如100)',
+  `total_weekly_limit` int(11) NULL DEFAULT NULL COMMENT '总名额-每周限制(如50)',
+  `total_daily_limit` int(11) NULL DEFAULT NULL COMMENT '总名额-每日限制(如10)',
+  `person_monthly_limit` int(11) NULL DEFAULT NULL COMMENT '单人名额-每月限制(如100)',
+  `person_weekly_limit` int(11) NULL DEFAULT NULL COMMENT '单人名额-每周限制(如50)',
+  `person_daily_limit` int(11) NULL DEFAULT NULL COMMENT '单人名额-每日限制(如10)',
+  `begin_book_days` int(11) NULL DEFAULT 0 COMMENT '开始预约日(0表示当天)',
+  `advance_days` int(11) NULL DEFAULT 0 COMMENT '提前预约天数(0表示当天)',
+  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人',
+  `updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人',
+  `tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '机构id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '预约配置表' ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `appointment_group`;
+CREATE TABLE `appointment_group`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `date_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '日期类型:DAILY-每天, WEEKLY-每周, MONTHLY-每月, CUSTOM-自定义',
+  `week_days` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当date_type=WEEKLY时,存储周几,用逗号分隔,如"1,3,5"(1=周一)',
+  `month_days` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当date_type=MONTHLY时,存储几号,如"1,15"(可包含负数表示倒数日)',
+  `custom_dates` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当date_type=CUSTOM时,存储具体日期数组,如["2026-07-15","2026-07-20"]',
+  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人',
+  `updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人',
+  `tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '机构id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '预约组表' ROW_FORMAT = Dynamic;

+ 22 - 0
sql/mysql/visit_appointment.sql

@@ -0,0 +1,22 @@
+DROP TABLE IF EXISTS `visit_appointment`;
+CREATE TABLE `visit_appointment`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '预约ID',
+  `order_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约订单号',
+  `org_id` int(10) UNSIGNED ZEROFILL NOT NULL COMMENT '养老机构名称',
+  `org_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+  `elder_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '长者姓名',
+  `elder_room` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '长者房间号',
+  `visitor_open_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `visitor_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '预约人姓名',
+  `visitor_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '预约人手机号',
+  `relation` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '与长者关系',
+  `accompany_num` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '随行人数',
+  `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '预约备注',
+  `visit_date` date NOT NULL COMMENT '预约日期',
+  `time_slot` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '预约时间段',
+  `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态:0-待确认,1-已预约,2-已取消,3-已完成,4-已删除',
+  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `idx_visitor_open_id`(`visitor_open_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 12172 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '探访预约记录表' ROW_FORMAT = DYNAMIC;

+ 53 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/AppointmentConfigController.java

@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.system.controller.admin.biz;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigRespVO;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigSaveReqVO;
+import cn.iocoder.yudao.module.system.service.biz.AppointmentConfigService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.annotation.security.PermitAll;
+import javax.validation.Valid;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * 管理后台 - 预约配置
+ *
+ * @author system
+ */
+@Tag(name = "管理后台 - 预约配置")
+@RestController
+@RequestMapping("/appointmentConfig")
+public class AppointmentConfigController {
+
+    @Resource
+    private AppointmentConfigService appointmentConfigService;
+
+    @PostMapping("/add")
+    @Operation(summary = "预约配置新增")
+    public CommonResult<Boolean> add(@RequestBody @Valid AppointmentConfigSaveReqVO reqVO) {
+        appointmentConfigService.add(reqVO);
+        return success(true);
+    }
+
+    @PostMapping("/update")
+    @Operation(summary = "预约配置更新(先删除后新增)")
+    public CommonResult<Boolean> update(@RequestBody @Valid AppointmentConfigSaveReqVO reqVO) {
+        appointmentConfigService.update(reqVO);
+        return success(true);
+    }
+
+    @GetMapping("/getByTenant")
+    @Operation(summary = "获取某机构的预约配置与预约组")
+    @PermitAll
+    @Parameter(name = "tenantId", description = "机构id", required = true, example = "1024")
+    public CommonResult<AppointmentConfigRespVO> getByTenant(@RequestParam("tenantId") Long tenantId) {
+        return success(appointmentConfigService.getByTenant(tenantId));
+    }
+
+}

+ 8 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/ElderlyHealthRecordController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
 import java.io.IOException;
@@ -88,4 +89,11 @@ public class ElderlyHealthRecordController {
         return success(elderlyHealthRecordService.importHealthRecord(dataList));
     }
 
+    @GetMapping("/import-template")
+    @Operation(summary = "下载健康档案导入模板")
+    @TenantIgnore
+    public void importTemplate(HttpServletResponse response) throws IOException {
+        elderlyHealthRecordService.exportImportTemplate(response);
+    }
+
 }

+ 36 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/VisitAppointmentController.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.module.system.controller.admin.biz;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VisitAppointmentCountRespVO;
+import cn.iocoder.yudao.module.system.service.miniapp.VisitAppointmentService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * 管理后台 - 探访预约统计(yanglao-jiashu 数据源)
+ *
+ * @author system
+ */
+@Tag(name = "管理后台 - 探访预约统计")
+@RestController
+@RequestMapping("/visitAppointment")
+public class VisitAppointmentController {
+
+    @Resource
+    private VisitAppointmentService visitAppointmentService;
+
+    @GetMapping("/count")
+    @Operation(summary = "获取当日、当周、当月的预约参观数量")
+    public CommonResult<VisitAppointmentCountRespVO> count(@RequestParam(name = "tenantId") Long tenantId) {
+        return success(visitAppointmentService.getVisitCount(tenantId));
+    }
+
+}

+ 28 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/AppointmentConfigRespVO.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.system.controller.admin.biz.vo;
+
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentConfigDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentGroupDO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 预约配置与预约组响应 VO
+ */
+@Data
+public class AppointmentConfigRespVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 预约配置对象
+     */
+    private AppointmentConfigDO config;
+
+    /**
+     * 预约组数组
+     */
+    private List<AppointmentGroupDO> group;
+
+}

+ 32 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/AppointmentConfigSaveReqVO.java

@@ -0,0 +1,32 @@
+package cn.iocoder.yudao.module.system.controller.admin.biz.vo;
+
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentConfigDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentGroupDO;
+import lombok.Data;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 预约配置新增/更新请求 VO
+ *
+ * 前端传入的 JSON 包含 config 对象与 group 数组
+ */
+@Data
+public class AppointmentConfigSaveReqVO {
+
+    /**
+     * 预约配置对象
+     */
+    @NotNull(message = "预约配置不能为空")
+    @Valid
+    private AppointmentConfigDO config;
+
+    /**
+     * 预约组数组
+     */
+    @Valid
+    private List<AppointmentGroupDO> group;
+
+}

+ 30 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/VisitAppointmentCountRespVO.java

@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.system.controller.admin.biz.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 预约参观数量统计响应 VO
+ */
+@Data
+public class VisitAppointmentCountRespVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 当日预约参观数量
+     */
+    private Long todayCount;
+
+    /**
+     * 当周预约参观数量
+     */
+    private Long weekCount;
+
+    /**
+     * 当月预约参观数量
+     */
+    private Long monthCount;
+
+}

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/assessment/ElderlyAssessmentPageReqVO.java

@@ -30,6 +30,9 @@ public class ElderlyAssessmentPageReqVO extends PageParam {
     @Schema(description = "长者id")
     private Long elderId;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessanxiety/ElderlyAssessAnxietyPageReqVO.java

@@ -27,6 +27,9 @@ public class ElderlyAssessAnxietyPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
     private LocalDate[] assessDate;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessattackriskfactors/ElderlyAssessAttackRiskFactorsPageReqVO.java

@@ -30,6 +30,9 @@ public class ElderlyAssessAttackRiskFactorsPageReqVO extends PageParam {
     @Schema(description = "长者id")
     private Long elderId;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessdepression/ElderlyAssessDepressionPageReqVO.java

@@ -27,6 +27,9 @@ public class ElderlyAssessDepressionPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
     private LocalDate[] assessDate;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassessperceptioncommunication/ElderlyAssessPerceptionCommunicationPageReqVO.java

@@ -30,6 +30,9 @@ public class ElderlyAssessPerceptionCommunicationPageReqVO extends PageParam {
     @Schema(description = "长者id")
     private Long elderId;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesspsychologysocial/ElderlyAssessPsychologySocialPageReqVO.java

@@ -27,6 +27,9 @@ public class ElderlyAssessPsychologySocialPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
     private LocalDate[] assessDate;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesssimplementalstate/ElderlyAssessSimpleMentalStatePageReqVO.java

@@ -30,6 +30,9 @@ public class ElderlyAssessSimpleMentalStatePageReqVO extends PageParam {
     @Schema(description = "长者id")
     private Long elderId;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/elderlyassesssuiciderisk/ElderlyAssessSuicideRiskPageReqVO.java

@@ -30,6 +30,9 @@ public class ElderlyAssessSuicideRiskPageReqVO extends PageParam {
     @Schema(description = "长者id")
     private Long elderId;
 
+    @Schema(description = "楼层id")
+    private Long floorId;
+
     @Schema(description = "机构id数组")
     private Long[] tenantIds;
 }

+ 73 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/AppointmentConfigDO.java

@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.module.system.dal.dataobject.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseNoDeleteDO;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 预约配置 DO
+ *
+ * @author system
+ */
+@TableName("appointment_config")
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AppointmentConfigDO extends BaseNoDeleteDO {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 预约总开关:0-关闭,1-开启
+     */
+    private Integer enabled;
+
+    /**
+     * 总名额-每月限制(如100)
+     */
+    private Integer totalMonthlyLimit;
+
+    /**
+     * 总名额-每周限制(如50)
+     */
+    private Integer totalWeeklyLimit;
+
+    /**
+     * 总名额-每日限制(如10)
+     */
+    private Integer totalDailyLimit;
+
+    /**
+     * 单人名额-每月限制(如100)
+     */
+    private Integer personMonthlyLimit;
+
+    /**
+     * 单人名额-每周限制(如50)
+     */
+    private Integer personWeeklyLimit;
+
+    /**
+     * 单人名额-每日限制(如10)
+     */
+    private Integer personDailyLimit;
+
+    /**
+     * 开始预约日(0表示当天)
+     */
+    private Integer beginBookDays;
+
+    /**
+     * 提前预约天数(0表示当天)
+     */
+    private Integer advanceDays;
+
+    /**
+     * 机构id
+     */
+    private Long tenantId;
+
+}

+ 48 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/AppointmentGroupDO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.system.dal.dataobject.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseNoDeleteDO;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 预约组 DO
+ *
+ * @author system
+ */
+@TableName("appointment_group")
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AppointmentGroupDO extends BaseNoDeleteDO {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 日期类型:DAILY-每天, WEEKLY-每周, MONTHLY-每月, CUSTOM-自定义
+     */
+    private String dateType;
+
+    /**
+     * 当date_type=WEEKLY时,存储周几,用逗号分隔,如"1,3,5"(1=周一)
+     */
+    private String weekDays;
+
+    /**
+     * 当date_type=MONTHLY时,存储几号,如"1,15"(可包含负数表示倒数日)
+     */
+    private String monthDays;
+
+    /**
+     * 当date_type=CUSTOM时,存储具体日期数组,如["2026-07-15","2026-07-20"]
+     */
+    private String customDates;
+
+    /**
+     * 机构id
+     */
+    private Long tenantId;
+
+}

+ 106 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/miniapp/VisitAppointmentDO.java

@@ -0,0 +1,106 @@
+package cn.iocoder.yudao.module.system.dal.dataobject.miniapp;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * 探访预约记录 DO(yanglao-jiashu 数据源)
+ *
+ * @author system
+ */
+@TableName("visit_appointment")
+@Data
+public class VisitAppointmentDO {
+
+    /**
+     * 预约ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 预约订单号
+     */
+    private String orderId;
+
+    /**
+     * 养老机构id
+     */
+    private Long orgId;
+
+    /**
+     * 养老机构名称
+     */
+    private String orgName;
+
+    /**
+     * 长者姓名
+     */
+    private String elderName;
+
+    /**
+     * 长者房间号
+     */
+    private String elderRoom;
+
+    /**
+     * 访客微信 openId
+     */
+    private String visitorOpenId;
+
+    /**
+     * 预约人姓名
+     */
+    private String visitorName;
+
+    /**
+     * 预约人手机号
+     */
+    private String visitorPhone;
+
+    /**
+     * 与长者关系
+     */
+    private String relation;
+
+    /**
+     * 随行人数
+     */
+    private Integer accompanyNum;
+
+    /**
+     * 预约备注
+     */
+    private String note;
+
+    /**
+     * 预约日期
+     */
+    private LocalDate visitDate;
+
+    /**
+     * 预约时间段
+     */
+    private String timeSlot;
+
+    /**
+     * 状态:0-待确认,1-已预约,2-已取消,3-已完成,4-已删除
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createdAt;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updatedAt;
+
+}

+ 9 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/AppointmentConfigMapper.java

@@ -0,0 +1,9 @@
+package cn.iocoder.yudao.module.system.dal.mysql.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentConfigDO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AppointmentConfigMapper extends BaseMapperX<AppointmentConfigDO> {
+}

+ 9 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/AppointmentGroupMapper.java

@@ -0,0 +1,9 @@
+package cn.iocoder.yudao.module.system.dal.mysql.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentGroupDO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AppointmentGroupMapper extends BaseMapperX<AppointmentGroupDO> {
+}

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessAnxietyMapper.java

@@ -16,6 +16,8 @@ public interface ElderlyAssessAnxietyMapper extends BaseMapperX<ElderlyAssessAnx
                 .likeIfPresent(ElderlyAssessAnxietyDO::getAssessor, reqVO.getAssessor())
                 .betweenIfPresent(ElderlyAssessAnxietyDO::getAssessDate, reqVO.getAssessDate())
                 .inIfPresent(ElderlyAssessAnxietyDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessAnxietyDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessAnxietyDO::getAssessDate, ElderlyAssessAnxietyDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessAttackRiskFactorsMapper.java

@@ -17,6 +17,8 @@ public interface ElderlyAssessAttackRiskFactorsMapper extends BaseMapperX<Elderl
                 .betweenIfPresent(ElderlyAssessAttackRiskFactorsDO::getAssessDate, reqVO.getAssessDate())
                 .eqIfPresent(ElderlyAssessAttackRiskFactorsDO::getElderId, reqVO.getElderId())
                 .inIfPresent(ElderlyAssessAttackRiskFactorsDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessAttackRiskFactorsDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessAttackRiskFactorsDO::getAssessDate, ElderlyAssessAttackRiskFactorsDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessDepressionMapper.java

@@ -16,6 +16,8 @@ public interface ElderlyAssessDepressionMapper extends BaseMapperX<ElderlyAssess
                 .likeIfPresent(ElderlyAssessDepressionDO::getAssessor, reqVO.getAssessor())
                 .betweenIfPresent(ElderlyAssessDepressionDO::getAssessDate, reqVO.getAssessDate())
                 .inIfPresent(ElderlyAssessDepressionDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessDepressionDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessDepressionDO::getAssessDate, ElderlyAssessDepressionDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessPerceptionCommunicationMapper.java

@@ -17,6 +17,8 @@ public interface ElderlyAssessPerceptionCommunicationMapper extends BaseMapperX<
                 .betweenIfPresent(ElderlyAssessPerceptionCommunicationDO::getAssessDate, reqVO.getAssessDate())
                 .eqIfPresent(ElderlyAssessPerceptionCommunicationDO::getElderId, reqVO.getElderId())
                 .inIfPresent(ElderlyAssessPerceptionCommunicationDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessPerceptionCommunicationDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessPerceptionCommunicationDO::getAssessDate, ElderlyAssessPerceptionCommunicationDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessPsychologySocialMapper.java

@@ -16,6 +16,8 @@ public interface ElderlyAssessPsychologySocialMapper extends BaseMapperX<Elderly
                 .likeIfPresent(ElderlyAssessPsychologySocialDO::getAssessor, reqVO.getAssessor())
                 .betweenIfPresent(ElderlyAssessPsychologySocialDO::getAssessDate, reqVO.getAssessDate())
                 .inIfPresent(ElderlyAssessPsychologySocialDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessPsychologySocialDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessPsychologySocialDO::getAssessDate, ElderlyAssessPsychologySocialDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessSimpleMentalStateMapper.java

@@ -17,6 +17,8 @@ public interface ElderlyAssessSimpleMentalStateMapper extends BaseMapperX<Elderl
                 .betweenIfPresent(ElderlyAssessSimpleMentalStateDO::getAssessDate, reqVO.getAssessDate())
                 .eqIfPresent(ElderlyAssessSimpleMentalStateDO::getElderId, reqVO.getElderId())
                 .inIfPresent(ElderlyAssessSimpleMentalStateDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessSimpleMentalStateDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessSimpleMentalStateDO::getAssessDate, ElderlyAssessSimpleMentalStateDO::getId));
     }
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyAssessSuicideRiskMapper.java

@@ -17,6 +17,8 @@ public interface ElderlyAssessSuicideRiskMapper extends BaseMapperX<ElderlyAsses
                 .betweenIfPresent(ElderlyAssessSuicideRiskDO::getAssessDate, reqVO.getAssessDate())
                 .eqIfPresent(ElderlyAssessSuicideRiskDO::getElderId, reqVO.getElderId())
                 .inIfPresent(ElderlyAssessSuicideRiskDO::getTenantId, reqVO.getTenantIds())
+                .inSql(reqVO.getFloorId() != null, ElderlyAssessSuicideRiskDO::getElderId,
+                        "SELECT id FROM elderly_info WHERE floor_id = " + reqVO.getFloorId())
                 .orderByDesc(ElderlyAssessSuicideRiskDO::getAssessDate, ElderlyAssessSuicideRiskDO::getId));
     }
 }

+ 27 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/miniapp/VisitAppointmentMapper.java

@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.system.dal.mysql.miniapp;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.system.dal.dataobject.miniapp.VisitAppointmentDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.time.LocalDate;
+
+@Mapper
+public interface VisitAppointmentMapper extends BaseMapperX<VisitAppointmentDO> {
+
+    /**
+     * 统计指定预约日期范围内的预约参观数量(排除已删除 status=4)
+     *
+     * @param startDate 开始日期(含)
+     * @param endDate   结束日期(含)
+     * @return 预约数量
+     */
+    default Long countByVisitDateRange(Long tenantId,LocalDate startDate, LocalDate endDate) {
+        return selectCount(new LambdaQueryWrapperX<VisitAppointmentDO>()
+                .eq(VisitAppointmentDO::getOrderId,tenantId)
+                .between(VisitAppointmentDO::getVisitDate, startDate, endDate)
+                .ne(VisitAppointmentDO::getStatus, 4));
+    }
+
+}

+ 35 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/AppointmentConfigService.java

@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.system.service.biz;
+
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigRespVO;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigSaveReqVO;
+
+/**
+ * 预约配置 Service
+ *
+ * @author system
+ */
+public interface AppointmentConfigService {
+
+    /**
+     * 新增预约配置(同时保存配置与预约组)
+     *
+     * @param reqVO 包含 config 对象与 group 数组
+     */
+    void add(AppointmentConfigSaveReqVO reqVO);
+
+    /**
+     * 更新预约配置(先删除后新增)
+     *
+     * @param reqVO 包含 config 对象与 group 数组
+     */
+    void update(AppointmentConfigSaveReqVO reqVO);
+
+    /**
+     * 获取某机构的预约配置与预约组
+     *
+     * @param tenantId 机构id
+     * @return 预约配置与预约组
+     */
+    AppointmentConfigRespVO getByTenant(Long tenantId);
+
+}

+ 86 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/AppointmentConfigServiceImpl.java

@@ -0,0 +1,86 @@
+package cn.iocoder.yudao.module.system.service.biz;
+
+import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigRespVO;
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AppointmentConfigSaveReqVO;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentConfigDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.AppointmentGroupDO;
+import cn.iocoder.yudao.module.system.dal.mysql.biz.AppointmentConfigMapper;
+import cn.iocoder.yudao.module.system.dal.mysql.biz.AppointmentGroupMapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 预约配置 Service 实现
+ *
+ * @author system
+ */
+@Service
+public class AppointmentConfigServiceImpl implements AppointmentConfigService {
+
+    @Resource
+    private AppointmentConfigMapper appointmentConfigMapper;
+
+    @Resource
+    private AppointmentGroupMapper appointmentGroupMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(AppointmentConfigSaveReqVO reqVO) {
+        AppointmentConfigDO config = reqVO.getConfig();
+        Long tenantId = config.getTenantId() != null ? config.getTenantId() : TenantContextHolder.getTenantId();
+        config.setTenantId(tenantId);
+        appointmentConfigMapper.insert(config);
+
+        List<AppointmentGroupDO> groupList = reqVO.getGroup();
+        if (!CollectionUtils.isEmpty(groupList)) {
+            groupList.forEach(group -> group.setTenantId(tenantId));
+            appointmentGroupMapper.insertBatch(groupList);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(AppointmentConfigSaveReqVO reqVO) {
+        AppointmentConfigDO config = reqVO.getConfig();
+        Long tenantId = config.getTenantId() != null ? config.getTenantId() : TenantContextHolder.getTenantId();
+
+        // 先删除:清除该机构下已有的配置与预约组
+        appointmentConfigMapper.delete(new LambdaQueryWrapper<AppointmentConfigDO>()
+                .eq(AppointmentConfigDO::getTenantId, tenantId));
+        appointmentGroupMapper.delete(new LambdaQueryWrapper<AppointmentGroupDO>()
+                .eq(AppointmentGroupDO::getTenantId, tenantId));
+
+        // 后新增
+        config.setId(null);
+        config.setTenantId(tenantId);
+        appointmentConfigMapper.insert(config);
+
+        List<AppointmentGroupDO> groupList = reqVO.getGroup();
+        if (!CollectionUtils.isEmpty(groupList)) {
+            groupList.forEach(group -> {
+                group.setId(null);
+                group.setTenantId(tenantId);
+            });
+            appointmentGroupMapper.insertBatch(groupList);
+        }
+    }
+
+    @Override
+    public AppointmentConfigRespVO getByTenant(Long tenantId) {
+        AppointmentConfigDO config = appointmentConfigMapper.selectOne(
+                new LambdaQueryWrapper<AppointmentConfigDO>().eq(AppointmentConfigDO::getTenantId, tenantId));
+        List<AppointmentGroupDO> groups = appointmentGroupMapper.selectList(
+                new LambdaQueryWrapper<AppointmentGroupDO>().eq(AppointmentGroupDO::getTenantId, tenantId));
+        AppointmentConfigRespVO respVO = new AppointmentConfigRespVO();
+        respVO.setConfig(config);
+        respVO.setGroup(groups);
+        return respVO;
+    }
+
+}

+ 9 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/ElderlyHealthRecordService.java

@@ -5,6 +5,8 @@ import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ElderlyHealthRecor
 import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ElderlyHealthRecordPageReqVO;
 import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyHealthRecordDO;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -27,4 +29,11 @@ public interface ElderlyHealthRecordService {
      * @return 导入结果(successCount / failCount / errorList)
      */
     Map<String, Object> importHealthRecord(List<ElderlyHealthRecordImportExcelVO> dataList);
+
+    /**
+     * 导出健康档案导入模板
+     *
+     * @param response HTTP 响应
+     */
+    void exportImportTemplate(HttpServletResponse response) throws IOException;
 }

+ 9 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/biz/ElderlyHealthRecordServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.system.service.biz;
 
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
 import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ElderlyHealthRecordImportExcelVO;
@@ -18,8 +19,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -149,5 +153,10 @@ public class ElderlyHealthRecordServiceImpl implements ElderlyHealthRecordServic
         record.setDietaryGuidelines(vo.getDietaryGuidelines());
     }
 
+    @Override
+    public void exportImportTemplate(HttpServletResponse response) throws IOException {
+        ExcelUtils.write(response, "健康档案导入模板.xlsx", "健康档案",
+                ElderlyHealthRecordImportExcelVO.class, Collections.emptyList());
+    }
 
 }

+ 19 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/miniapp/VisitAppointmentService.java

@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.system.service.miniapp;
+
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VisitAppointmentCountRespVO;
+
+/**
+ * 探访预约 Service(yanglao-jiashu 数据源)
+ *
+ * @author system
+ */
+public interface VisitAppointmentService {
+
+    /**
+     * 获取当日、当周、当月的预约参观数量
+     *
+     * @return 当日 / 当周 / 当月的预约数量
+     */
+    VisitAppointmentCountRespVO getVisitCount(Long tenantId);
+
+}

+ 61 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/miniapp/VisitAppointmentServiceImpl.java

@@ -0,0 +1,61 @@
+package cn.iocoder.yudao.module.system.service.miniapp;
+
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VisitAppointmentCountRespVO;
+import cn.iocoder.yudao.module.system.dal.mysql.miniapp.VisitAppointmentMapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+
+/**
+ * 探访预约 Service 实现(yanglao-jiashu 数据源)
+ *
+ * @author system
+ */
+@Service
+@DS("miniapp")
+public class VisitAppointmentServiceImpl implements VisitAppointmentService {
+
+    @Resource
+    private VisitAppointmentMapper visitAppointmentMapper;
+
+    @Override
+    public VisitAppointmentCountRespVO getVisitCount(Long tenantId) {
+        VisitAppointmentCountRespVO respVO = new VisitAppointmentCountRespVO();
+        respVO.setTodayCount(getTodayCount(tenantId));
+        respVO.setWeekCount(getWeekCount(tenantId));
+        respVO.setMonthCount(getMonthCount(tenantId));
+        return respVO;
+    }
+
+    /**
+     * 当日预约参观数量
+     */
+    private Long getTodayCount(Long tenantId) {
+        LocalDate today = LocalDate.now();
+        return visitAppointmentMapper.countByVisitDateRange(tenantId,today, today);
+    }
+
+    /**
+     * 当周(周一至周日)预约参观数量
+     */
+    private Long getWeekCount(Long tenantId) {
+        LocalDate now = LocalDate.now();
+        LocalDate monday = now.with(DayOfWeek.MONDAY);
+        LocalDate sunday = now.with(DayOfWeek.SUNDAY);
+        return visitAppointmentMapper.countByVisitDateRange(tenantId,monday, sunday);
+    }
+
+    /**
+     * 当月(1号至月末)预约参观数量
+     */
+    private Long getMonthCount(Long tenantId) {
+        LocalDate now = LocalDate.now();
+        LocalDate firstDay = now.withDayOfMonth(1);
+        LocalDate lastDay = now.withDayOfMonth(now.lengthOfMonth());
+        return visitAppointmentMapper.countByVisitDateRange(tenantId,firstDay, lastDay);
+    }
+
+}

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/ElderlyAntiEntertainmentMapper.xml

@@ -21,6 +21,9 @@
                 #{id}
             </foreach>
         </if>
+        <if test="reqVO.floorId != null">
+            AND obf.id = #{reqVO.floorId}
+        </if>
         <if test="reqVO.elderId != null">
             AND eae.elder_id = #{reqVO.elderId}
         </if>