| | |
| | | * @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; |
| | |
| | | */ |
| | | 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())); |
| | |
| | | @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; |
| | |
| | | <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"/> |
| | |
| | | dept_type, |
| | | dept_category, |
| | | archive_type, |
| | | followup_period, |
| | | dept_codes, |
| | | icd10_codes, |
| | | remark, |
| | |
| | | <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 != ''"> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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); |
| | |
| | | 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çæ¥è¯¢æ¡ä»¶æ¯å¦ä¸è´ |
| | |
| | | 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åç»ï¼æ¯ä¸ªä»»å¡å³ä¸ä¸ªç
ç§éè®¿ä»»å¡ |
| | |
| | | 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) { |
| | |
| | | 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": |
| | |
| | | @ApiModelProperty(value = "é«å±å¿ä¸æ¡-æé访æ¶é´") |
| | | private Date plannedFollowTime; |
| | | |
| | | /** éè®¿å¨æ */ |
| | | @ApiModelProperty(value = "éè®¿å¨æ") |
| | | private String followupPeriod; |
| | | |
| | | /** é«å±å¿ä¸æ¡-çé¿åè²æ£æµ */ |
| | | @ApiModelProperty(value = "é«å±å¿ä¸æ¡-çé¿åè²æ£æµ") |
| | | private String hrcGrowthDevelopmentMonitoring; |
| | |
| | | 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; |
| | |
| | | */ |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | <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"/> |
| | |
| | | high_risk_child_type, |
| | | high_risk_child_name, |
| | | planned_follow_time, |
| | | followup_period, |
| | | hrc_growth_development_monitoring, |
| | | hrc_neurological_evaluation, |
| | | hrc_intervention_records, |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ============================================================================= |
| | | -- éè®¿å¨æç»ä¸å段 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; |