已修改9个文件
已添加1个文件
110 ■■■■■ 文件已修改
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-patarchive/src/main/java/com/ruoyi/patarchive/domain/PatSpecificArchiveGenerateConfig.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-patarchive/src/main/resources/mapper/patarchive/PatSpecificArchiveGenerateConfigMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/controller/ServiceSubtaskController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatChildArchiveDetail.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/message/LishuiMessageConfigProviderImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatSpecificArchiveGenerateServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatChildArchiveDetailMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/pat_child_archive_detail_and_config_add_followup_period_20261109.sql 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -542,8 +542,12 @@
     * @param dataClazz æ•°æ®å¯¹è±¡çš„Class
     */
    @SuppressWarnings("unchecked")
    public void writeAdditionalSheet(List<?> dataList, String sheetName, Class<?> dataClazz) {        if (dataList == null) {
            dataList = new ArrayList<>();
    public void writeAdditionalSheet(List<?> dataList, String sheetName, Class<?> dataClazz) {
        // æ²¡æœ‰æ•°æ®æˆ–没有行类型时跳过附加 Sheet:
        // SatisfactionExportBundle.empty() çš„ rowClass ä¸º null,若继续执行会把 this.clazz ç½®ç©ºï¼Œ
        // éšåŽ getFields() è°ƒç”¨ clazz.getSuperclass() è§¦å‘ NullPointerException。
        if (dataClazz == null || dataList == null || dataList.isEmpty()) {
            return;
        }
        // ä¿å­˜åŽŸå§‹çŠ¶æ€
        Class<T> originClazz = this.clazz;
@@ -1341,6 +1345,11 @@
     */
    public List<Object[]> getFields() {
        List<Object[]> fields = new ArrayList<Object[]>();
        // é˜²å¾¡ï¼šclazz ä¸ºç©ºæ—¶ä¸å†è°ƒç”¨ getSuperclass(),避免 NullPointerException。
        if (clazz == null) {
            log.warn("ExcelUtil.clazz ä¸ºç©ºï¼Œæ— æ³•解析导出字段,跳过当前 Sheet");
            return fields;
        }
        List<Field> tempFields = new ArrayList<>();
        tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
        tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
ruoyi-patarchive/src/main/java/com/ruoyi/patarchive/domain/PatSpecificArchiveGenerateConfig.java
@@ -36,6 +36,11 @@
    @ApiModelProperty(value = "档案类型: å¦‡ç§‘档案类型(1 æ—©å­•关爱2 å›´ç»ç»æœŸMHI),儿科档案类型(1营养性疾病 2学习困难 3高危儿专案)")
    private String archiveType;
    /** éšè®¿å‘¨æœŸ */
    @Excel(name = "随访周期")
    @ApiModelProperty(value = "随访周期")
    private String followupPeriod;
    /** ç§‘室Code集合(JSON格式,如 ["D001","D002"]) */
    @ApiModelProperty(value = "科室Code集合(JSON格式,如 [\"D001\",\"D002\"])")
    private String deptCodes;
ruoyi-patarchive/src/main/resources/mapper/patarchive/PatSpecificArchiveGenerateConfigMapper.xml
@@ -9,6 +9,7 @@
        <result property="deptType" column="dept_type"/>
        <result property="deptCategory" column="dept_category"/>
        <result property="archiveType" column="archive_type"/>
        <result property="followupPeriod" column="followup_period"/>
        <result property="deptCodes" column="dept_codes"/>
        <result property="icd10Codes" column="icd10_codes"/>
        <result property="remark" column="remark"/>
@@ -26,6 +27,7 @@
               dept_type,
               dept_category,
               archive_type,
               followup_period,
               dept_codes,
               icd10_codes,
               remark,
@@ -47,6 +49,7 @@
            <if test="deptType != null and deptType != ''">and dept_type = #{deptType}</if>
            <if test="deptCategory != null and deptCategory != ''">and dept_category = #{deptCategory}</if>
            <if test="archiveType != null and archiveType != ''">and archive_type = #{archiveType}</if>
            <if test="followupPeriod != null and followupPeriod != ''">and followup_period = #{followupPeriod}</if>
            <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
            <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
            <if test="params.beginTime != null and params.beginTime != ''">
@@ -77,6 +80,7 @@
            <if test="deptType != null">dept_type,</if>
            <if test="deptCategory != null">dept_category,</if>
            <if test="archiveType != null">archive_type,</if>
            <if test="followupPeriod != null">followup_period,</if>
            <if test="deptCodes != null">dept_codes,</if>
            <if test="icd10Codes != null">icd10_codes,</if>
            <if test="remark != null">remark,</if>
@@ -92,6 +96,7 @@
            <if test="deptType != null">#{deptType},</if>
            <if test="deptCategory != null">#{deptCategory},</if>
            <if test="archiveType != null">#{archiveType},</if>
            <if test="followupPeriod != null">#{followupPeriod},</if>
            <if test="deptCodes != null">#{deptCodes},</if>
            <if test="icd10Codes != null">#{icd10Codes},</if>
            <if test="remark != null">#{remark},</if>
@@ -111,6 +116,7 @@
            <if test="deptType != null">dept_type = #{deptType},</if>
            <if test="deptCategory != null">dept_category = #{deptCategory},</if>
            <if test="archiveType != null">archive_type = #{archiveType},</if>
            <if test="followupPeriod != null">followup_period = #{followupPeriod},</if>
            <if test="deptCodes != null">dept_codes = #{deptCodes},</if>
            <if test="icd10Codes != null">icd10_codes = #{icd10Codes},</if>
            <if test="remark != null">remark = #{remark},</if>
ruoyi-task/src/main/java/com/ruoyi/task/controller/ServiceSubtaskController.java
@@ -1313,10 +1313,12 @@
            Boolean redisFlag = false;
            if (MapUtils.isNotEmpty(redisMap)) {
                long tCmp = System.currentTimeMillis();
                ServiceSubtaskEntity oldCondition = (ServiceSubtaskEntity) redisMap.get("searchCondition");
                ServiceSubtaskEntity oldCondition = convertCachedCondition(redisMap.get("searchCondition"));
                if (ObjectUtils.isNotEmpty(oldCondition) && isSameCondition(oldCondition, serviceSubtaskEntity)) {
                    redisFlag = true;
                    map = redisMap;
                    // é¡ºæ‰‹å›žå¡«è½¬æ¢åŽçš„实体,让这条缓存下次能以正确类型反序列化
                    map.put("searchCondition", oldCondition);
                    redisCache.setCacheObject(userId + "patItemCount", map, 60, TimeUnit.MINUTES);
                }
                log.info("[patItem耗时] 4.2 æ¡ä»¶æ¯”对={}ms,命中={}", System.currentTimeMillis() - tCmp, redisFlag);
@@ -1336,6 +1338,36 @@
        return map;
    }
    /**
     * æŠŠ Redis ç¼“存里的查询条件还原成 {@link ServiceSubtaskEntity}。
     * <p>
     * ç¼“存由 {@code FastJson2JsonRedisSerializer} æŒ‰ {@code Object.class} ååºåˆ—化:
     * å½“ {@code searchCondition} çš„ {@code @type} ç¼ºå¤±ã€æˆ–指向已迁移的旧包名
     * ï¼ˆå¦‚ {@code com.smartor.domain.entity.ServiceSubtaskEntity})时,fastjson2 ä¼š
     * é™é»˜é€€åŒ–成 {@link com.alibaba.fastjson2.JSONObject},直接强转会抛
     * {@code ClassCastException}。这里统一转换;转换失败返回 {@code null},
     * è°ƒç”¨æ–¹æŒ‰ç¼“存未命中处理(重新查库),避免整个接口 500。
     */
    private ServiceSubtaskEntity convertCachedCondition(Object cachedCondition) {
        if (cachedCondition == null) {
            return null;
        }
        if (cachedCondition instanceof ServiceSubtaskEntity) {
            return (ServiceSubtaskEntity) cachedCondition;
        }
        try {
            // ä¸èƒ½ç›´æŽ¥ç”¨ TypeUtils.cast / toJavaObject:旧缓存里的 @type å¯èƒ½æŒ‡å‘已迁移的类,
            // fastjson2 ä¼šæŒ‰ @type åŽ»æ‰¾ç±»å¹¶æŠ› "No suitable ObjectReader found"。
            // è½¬æˆ JSON å­—符串后按目标类解析,未开启 SupportAutoType æ—¶ @type åªä¼šè¢«å½“作普通字段忽略。
            return com.alibaba.fastjson2.JSON.parseObject(
                    com.alibaba.fastjson2.JSON.toJSONString(cachedCondition),
                    ServiceSubtaskEntity.class);
        } catch (Exception e) {
            log.warn("【patItemCount】缓存中的查询条件无法还原为 ServiceSubtaskEntity,按缓存未命中处理,实际类型:{}",
                    cachedCondition.getClass().getName(), e);
            return null;
        }
    }
    /**
     * æ¯”较两个ServiceSubtaskVO的查询条件是否一致
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java
@@ -2459,7 +2459,10 @@
            if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
                groupKey = drcode;
            } else {
                groupKey = "deptcode";
                // 2026-11 å­—段重命名后:deptcode æ˜¯åœ¨é™¢ç§‘室(历史数据为空),
                // å‡ºé™¢ç§‘室已改名为 leaveldeptcode,分组必须用后者,
                // å¦åˆ™ getSfStatisticsGroupKey ä¼šè¿”回 NULL,拼成 IN (NULL) å¯¼è‡´æ•´è¡¨æŸ¥ç©ºã€‚
                groupKey = "leaveldeptcode";
            }
        } else if (serviceSubtaskCountReq.getStatisticaltype() != null && serviceSubtaskCountReq.getStatisticaltype() == 3) {
            // ç—…种统计:按任务ID分组,每个任务即一个病种随访任务
@@ -2470,6 +2473,17 @@
        Map<String, List<ServiceSubtask>> collect = new HashMap<>();
        serviceSubtaskCountReq.setGroupKey(groupKey);
        List<String> groupKeyList = serviceSubtaskMapper.getSfStatisticsGroupKey(serviceSubtaskCountReq);
        /*
         * åˆ†ç»„键可能为 NULL(历史数据、或重命名后尚未回填的在院维度列),
         * ç›´æŽ¥æ‹¼è¿› SQL ä¼šå˜æˆ `AND IFNULL(列,'Unknown') IN (NULL)`,恒不成立,整张统计表为空。
         * è¿™é‡Œç»Ÿä¸€æˆ 'Unknown',与聚合 SQL çš„ IFNULL(列,'Unknown') å£å¾„对齐。
         */
        if (groupKeyList != null) {
            groupKeyList = groupKeyList.stream()
                    .map(key -> key == null ? "Unknown" : key)
                    .distinct()
                    .collect(Collectors.toList());
        }
        serviceSubtaskCountReq.setGroupKeyList(groupKeyList);
        List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq);
        switch (groupKey) {
@@ -2484,6 +2498,7 @@
                collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getManagementDoctorCode()).orElse("Unknown")));
                break;
            case "deptcode":
            case "leaveldeptcode":
                collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeaveldeptcode()).orElse("Unknown")));
                break;
            case "leavehospitaldistrictcode":
smartor/src/main/java/com/smartor/domain/PatChildArchiveDetail.java
@@ -227,6 +227,10 @@
    @ApiModelProperty(value = "高危儿专案-拟随访时间")
    private Date plannedFollowTime;
    /** éšè®¿å‘¨æœŸ */
    @ApiModelProperty(value = "随访周期")
    private String followupPeriod;
    /** é«˜å±å„¿ä¸“案-生长发育检测 */
    @ApiModelProperty(value = "高危儿专案-生长发育检测")
    private String hrcGrowthDevelopmentMonitoring;
smartor/src/main/java/com/smartor/message/LishuiMessageConfigProviderImpl.java
@@ -1,5 +1,6 @@
package com.smartor.message;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.message.sms.provider.ls.LishuiMessageConfig;
@@ -36,6 +37,12 @@
     */
    private static final String CONFIG_KEY = "ls.msg.info";
    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
    private static final TypeReference<Map<String, String>> MSG_INFO_TYPE =
            new TypeReference<Map<String, String>>() {
            };
    private final ISysConfigService configService;
    public LishuiMessageConfigProviderImpl(ISysConfigService configService) {
@@ -60,7 +67,7 @@
        Map<String, String> msgInfo = new HashMap<>();
        if (StringUtils.isNotEmpty(configValue)) {
            try {
                msgInfo = new ObjectMapper().readValue(configValue, Map.class);
                msgInfo = OBJECT_MAPPER.readValue(configValue, MSG_INFO_TYPE);
            } catch (Exception e) {
                log.error("【LishuiMessageConfigProviderImpl】解析 {} å¤±è´¥ï¼Œorgid:{},value:{},err:{}",
                        CONFIG_KEY, orgid, configValue, e.getMessage(), e);
smartor/src/main/java/com/smartor/service/impl/PatSpecificArchiveGenerateServiceImpl.java
@@ -178,6 +178,7 @@
                                                           PatSpecificArchiveGenerateConfig config, String campusid) {
        PatMaternityArchiveDetail detail = new PatMaternityArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setSourceType(SOURCE_TYPE_OUTHOSP);
        fillCommonDetail(detail, patMedOuthosp, patArchive, campusid);
        if (patArchive != null) {
@@ -190,6 +191,7 @@
                                                   PatSpecificArchiveGenerateConfig config, String campusid) {
        PatChildArchiveDetail detail = new PatChildArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setSourceType(SOURCE_TYPE_OUTHOSP);
        fillCommonChildDetail(detail, patMedOuthosp, patArchive, campusid);
        detail.setParentPhone(patArchive != null
smartor/src/main/resources/mapper/smartor/PatChildArchiveDetailMapper.xml
@@ -47,6 +47,7 @@
        <result property="highRiskChildType" column="high_risk_child_type"/>
        <result property="highRiskChildName" column="high_risk_child_name"/>
        <result property="plannedFollowTime" column="planned_follow_time"/>
        <result property="followupPeriod" column="followup_period"/>
        <result property="hrcGrowthDevelopmentMonitoring" column="hrc_growth_development_monitoring"/>
        <result property="hrcNeurologicalEvaluation" column="hrc_neurological_evaluation"/>
        <result property="hrcInterventionRecords" column="hrc_intervention_records"/>
@@ -107,6 +108,7 @@
               high_risk_child_type,
               high_risk_child_name,
               planned_follow_time,
               followup_period,
               hrc_growth_development_monitoring,
               hrc_neurological_evaluation,
               hrc_intervention_records,
@@ -132,6 +134,7 @@
            and del_flag = '0'
            <if test="archiveid != null">and archiveid = #{archiveid}</if>
            <if test="archiveType != null and archiveType != ''">and archive_type = #{archiveType}</if>
            <if test="followupPeriod != null and followupPeriod != ''">and followup_period = #{followupPeriod}</if>
            <if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
            <if test="outhospno != null and outhospno != ''">and outhospno = #{outhospno}</if>
            <if test="inhospno != null and inhospno != ''">and inhospno = #{inhospno}</if>
@@ -222,6 +225,7 @@
            <if test="highRiskChildType != null">high_risk_child_type,</if>
            <if test="highRiskChildName != null">high_risk_child_name,</if>
            <if test="plannedFollowTime != null">planned_follow_time,</if>
            <if test="followupPeriod != null">followup_period,</if>
            <if test="hrcGrowthDevelopmentMonitoring != null">hrc_growth_development_monitoring,</if>
            <if test="hrcNeurologicalEvaluation != null">hrc_neurological_evaluation,</if>
            <if test="hrcInterventionRecords != null">hrc_intervention_records,</if>
@@ -280,6 +284,7 @@
            <if test="highRiskChildType != null">#{highRiskChildType},</if>
            <if test="highRiskChildName != null">#{highRiskChildName},</if>
            <if test="plannedFollowTime != null">#{plannedFollowTime},</if>
            <if test="followupPeriod != null">#{followupPeriod},</if>
            <if test="hrcGrowthDevelopmentMonitoring != null">#{hrcGrowthDevelopmentMonitoring},</if>
            <if test="hrcNeurologicalEvaluation != null">#{hrcNeurologicalEvaluation},</if>
            <if test="hrcInterventionRecords != null">#{hrcInterventionRecords},</if>
@@ -342,6 +347,7 @@
            <if test="highRiskChildType != null">high_risk_child_type = #{highRiskChildType},</if>
            <if test="highRiskChildName != null">high_risk_child_name = #{highRiskChildName},</if>
            <if test="plannedFollowTime != null">planned_follow_time = #{plannedFollowTime},</if>
            <if test="followupPeriod != null">followup_period = #{followupPeriod},</if>
            <if test="hrcGrowthDevelopmentMonitoring != null">hrc_growth_development_monitoring = #{hrcGrowthDevelopmentMonitoring},</if>
            <if test="hrcNeurologicalEvaluation != null">hrc_neurological_evaluation = #{hrcNeurologicalEvaluation},</if>
            <if test="hrcInterventionRecords != null">hrc_intervention_records = #{hrcInterventionRecords},</if>
sql/pat_child_archive_detail_and_config_add_followup_period_20261109.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
-- =============================================================================
-- éšè®¿å‘¨æœŸç»Ÿä¸€å­—段 followup_period
-- æ¶‰åŠï¼š
--   1. pat_child_archive_detail(儿保档案详情)
--   2. pat_specific_archive_generate_config(专科档案生成配置)
-- è¯´æ˜Žï¼šå¦‡ä¿æ¡£æ¡ˆè¯¦æƒ… pat_maternity_archive_detail å·²æœ‰ followup_period,无需重复添加。
-- date:2026-11-09
-- =============================================================================
ALTER TABLE pat_child_archive_detail
    ADD COLUMN followup_period varchar(100) NULL COMMENT '随访周期' AFTER planned_follow_time;
ALTER TABLE pat_specific_archive_generate_config
    ADD COLUMN followup_period varchar(100) NULL COMMENT '随访周期' AFTER archive_type;