| docs/妇幼随访按周期发送功能说明_20261117.md | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| docs/妇幼随访按周期发送测试报告_20261117.md | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/mch/MchFollowupMessageSender.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/test/java/com/smartor/service/mch/MchFollowupLogicCheck.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
docs/¸¾Ó×Ëæ·Ã°´ÖÜÆÚ·¢Ë͹¦ÄÜ˵Ã÷_20261117.md
@@ -120,6 +120,20 @@ çä¿¡èç¹å¦æ `content` 为空ä¼è§£æå¤±è´¥ï¼è®¡åè¿å ¥âå¾ è¡¥å /é ç½®å¼å¸¸âç¶æã `content` å `titleName` æ¯æå ä½ç¬¦ï¼ ```text ${patname} æ£è å§å ${patid} æ£è ID ${phone} èç³»çµè¯ ${idcardno} è¯ä»¶å·ç ${plannedFollowTime} 卿åºåæ¥ï¼yyyy-MM-dd HH:mm:ssï¼ ${sourceBizNo} é¨è¯å·/ä½é¢å· ${archiveType} æ¡£æ¡ç±»åï¼1å¦ä¿ 2å¿ä¿ ${orgid} æºæID ${seq} èç¹é¡ºåº ``` ### 3.2 é´é + æ¬¡æ° ```json docs/¸¾Ó×Ëæ·Ã°´ÖÜÆÚ·¢ËͲâÊÔ±¨¸æ_20261117.md
@@ -11,10 +11,10 @@ | æµè¯å¥ä»¶ | ç¨ä¾æ° | éè¿ | 失败 | |---|---:|---:|---:| | `MchFollowupLogicCheck` | 40 | 40 | 0 | | `MchFollowupLogicCheck` | 41 | 41 | 0 | | `MchFollowupPlanServiceCheck` | 19 | 19 | 0 | | `MchFollowupSendServiceCheck` | 18 | 18 | 0 | | **å计** | **77** | **77** | **0** | | **å计** | **78** | **78** | **0** | ç»è®ºï¼**æ ¸å¿é»è¾æµè¯å ¨é¨éè¿ã** @@ -53,8 +53,9 @@ - æ°å¥½ 24 å°æ¶è¡¥åï¼ - è¶ è¿ 24 å°æ¶è¿æï¼ 8. èç¹ç»è£ ï¼ 9. 3 个æ°å¢ Mapper XML å¯è§£æï¼ 10. DDL èæ¬åå¨ã 9. å 容å ä½ç¬¦æ¸²æï¼`${patname}`ã`${patid}`ã`${phone}`ã`${plannedFollowTime}`ã`${seq}`ã`${orgid}`ï¼ï¼ 10. 3 个æ°å¢ Mapper XML å¯è§£æï¼ 11. DDL èæ¬åå¨ã ### 2.2 `MchFollowupPlanServiceCheck` @@ -124,7 +125,7 @@ ### 3.4 ç»ææè¦ ```text MchFollowupLogicCheck PASS=40ï¼FAIL=0 MchFollowupLogicCheck PASS=41ï¼FAIL=0 MchFollowupPlanServiceCheck PASS=19ï¼FAIL=0 MchFollowupSendServiceCheck PASS=18ï¼FAIL=0 ``` smartor/src/main/java/com/smartor/service/mch/MchFollowupMessageSender.java
@@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; /** * å¦å¹¼éè®¿æ¶æ¯åéå¨ã * @@ -28,7 +30,7 @@ public MchFollowupSendOutcome sendSms(MchFollowupPlan plan, MchFollowupPlanItem item) { String phone = plan == null ? null : plan.getPhone(); String content = item == null ? null : item.getContent(); String content = item == null ? null : renderContent(item.getContent(), plan, item); if (StringUtils.isBlank(phone)) { return MchFollowupSendOutcome.skip("ææºå·ä¸ºç©º"); } @@ -71,8 +73,8 @@ message.setIdCard(plan.getIdcardno()); message.setMobile(phone); message.setMedCardNo(plan.getSourceBizNo()); message.setTitleName(item.getTitleName()); message.setContent(item.getContent()); message.setTitleName(renderContent(item.getTitleName(), plan, item)); message.setContent(renderContent(item.getContent(), plan, item)); message.setUrl(item.getUrl()); String requestBody = requestSummary("wechat", phone, item.getTemplateId()); @@ -118,6 +120,37 @@ } } /** * 渲æå¦å¹¼é访å 容å ä½ç¬¦ãå½åæ¯æï¼ * ${patname}ã${patid}ã${phone}ã${idcardno}ã${plannedFollowTime}ã * ${sourceBizNo}ã${archiveType}ã${orgid}ã${seq}ã */ String renderContent(String text, MchFollowupPlan plan, MchFollowupPlanItem item) { if (StringUtils.isBlank(text) || plan == null) { return text; } String result = text; result = result.replace("${patname}", nvl(plan.getPatname())); result = result.replace("${patid}", plan.getPatid() == null ? "" : String.valueOf(plan.getPatid())); result = result.replace("${phone}", nvl(plan.getPhone())); result = result.replace("${idcardno}", nvl(plan.getIdcardno())); result = result.replace("${sourceBizNo}", nvl(plan.getSourceBizNo())); result = result.replace("${archiveType}", nvl(plan.getArchiveType())); result = result.replace("${orgid}", nvl(plan.getOrgid())); result = result.replace("${seq}", item == null || item.getSeq() == null ? "" : String.valueOf(item.getSeq())); if (plan.getPlannedFollowTime() != null) { result = result.replace("${plannedFollowTime}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(plan.getPlannedFollowTime())); } else { result = result.replace("${plannedFollowTime}", ""); } return result; } private String nvl(String value) { return value == null ? "" : value; } private String requestSummary(String sendType, String phone, Long templateId) { return "sendType=" + sendType + "ï¼phone=" + maskPhone(phone) smartor/src/test/java/com/smartor/service/mch/MchFollowupLogicCheck.java
@@ -2,6 +2,7 @@ import com.smartor.common.MchFollowupConstants; import com.smartor.domain.MchFollowupNode; import com.smartor.domain.MchFollowupPlan; import com.smartor.domain.MchFollowupPlanItem; import javax.xml.parsers.DocumentBuilderFactory; @@ -155,6 +156,22 @@ check("ç»è£ æ¶é´1", "2026-11-20 09:00:00", DATE_TIME.format(items.get(0).getSendTime())); check("ç»è£ æ¶é´3沿ç¨åºåæ¥14:30", "2026-11-27 14:30:00", DATE_TIME.format(items.get(2).getSendTime())); System.out.println("-- 8.1) å 容å ä½ç¬¦æ¸²æ --"); MchFollowupPlan plan = new MchFollowupPlan(); plan.setPatid(100L); plan.setPatname("å¼ ä¸"); plan.setPhone("13800000000"); plan.setOrgid("47226079133110211G1001"); plan.setPlannedFollowTime(baseline); MchFollowupPlanItem seqItem = new MchFollowupPlanItem(); seqItem.setSeq(2); MchFollowupMessageSender messageSender = new MchFollowupMessageSender(); check("å ä½ç¬¦æ¸²æ", "æ¨å¥½å¼ ä¸ï¼ID=100ï¼çµè¯=13800000000ï¼åºå=2026-11-20 14:30:00ï¼åºå·=2ï¼æºæ=47226079133110211G1001", messageSender.renderContent( "æ¨å¥½${patname}ï¼ID=${patid}ï¼çµè¯=${phone}ï¼åºå=${plannedFollowTime}ï¼åºå·=${seq}ï¼æºæ=${orgid}", plan, seqItem)); System.out.println("-- 9) Mapper XML å¯è§£ææ§ --"); String[] xmlFiles = new String[]{ "smartor/src/main/resources/mapper/smartor/MchFollowupPlanMapper.xml",