Commit 938e0d684d1c455f9f77ba93f83478914c7b622a
1 parent
ca47bdd127
Exists in
master
and in
1 other branch
update code
Showing 2 changed files with 21 additions and 11 deletions
platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/HelperUtils.java
View file @
938e0d6
... | ... | @@ -379,15 +379,16 @@ |
379 | 379 | * @return |
380 | 380 | */ |
381 | 381 | public static String getVaccineName(String content) { |
382 | - if (StringUtils.isNotEmpty(content)) | |
382 | + try { | |
383 | + if (StringUtils.isNotEmpty(content)) | |
384 | + { | |
385 | + return content.substring(content.indexOf("#")+1, content.lastIndexOf("#")); | |
386 | + } | |
387 | + }catch (Exception e) | |
383 | 388 | { |
384 | -// String[] arras = content.f | |
385 | -// if (arras != null) | |
386 | -// { | |
387 | -// | |
388 | -// } | |
389 | + return ""; | |
389 | 390 | } |
390 | - return null; | |
391 | + return ""; | |
391 | 392 | } |
392 | 393 | } |
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java
View file @
938e0d6
... | ... | @@ -452,8 +452,11 @@ |
452 | 452 | String messageContent = "【"+messagePrefix+"】"+template.getContent(); |
453 | 453 | messageContent = HelperUtils.replaceName(model.getName(), messageContent); |
454 | 454 | |
455 | - String vaccineTime = HelperUtils.getKeyword(start, end, "天"); | |
455 | + //接种时间 | |
456 | + String vaccineTime = start+"天"; | |
457 | + //疫苗名称 | |
456 | 458 | String vaccineName = HelperUtils.getVaccineName(template.getContent()); |
459 | + //疫苗接种人 | |
457 | 460 | String vaccinePerson = model.getName(); |
458 | 461 | |
459 | 462 | MsgRequest request = HelperUtils.getMessageRequest(messageContent, model.getMphone(), |
460 | 463 | |
461 | 464 | |
... | ... | @@ -509,12 +512,18 @@ |
509 | 512 | String messagePrefix = baseService.getSmsPrefix(config, model.getBuildDoctor(),ServiceObjEnums.BABYOBJ.getId()); |
510 | 513 | String messageContent = "【"+messagePrefix+"】"+template.getContent(); |
511 | 514 | messageContent = HelperUtils.replaceName(model.getName(), messageContent); |
512 | - String itemName = "疫苗接种提醒"; | |
513 | - String nextCheckTime = HelperUtils.getKeyword(start, end, "月龄"); | |
514 | 515 | |
516 | + //疫苗名称 | |
517 | + String vaccineName = HelperUtils.getVaccineName(template.getContent()); | |
518 | + //疫苗接种人 | |
519 | + String vaccinePerson = model.getName(); | |
520 | + //接种时间 | |
521 | + String vaccineTime = start+ "月龄"; | |
522 | + | |
523 | + | |
515 | 524 | MsgRequest request = HelperUtils.getMessageRequest(messageContent, model.getMphone(), |
516 | 525 | ServiceObjEnums.BABYOBJ.getId(), template.getSmsType(), |
517 | - model.getHospitalId(), template.getId(), model.getId(), itemName, nextCheckTime, "", | |
526 | + model.getHospitalId(), template.getId(), model.getId(), vaccineName, vaccinePerson, vaccineTime, | |
518 | 527 | WxTempleteIdEnums.ER_TONG_YI_MIAO_TIXING.getId(),service); |
519 | 528 | messages.add(request); |
520 | 529 |