Commit 0d2deb4c3c8704937d5a0e02636eb712a94c0e9b
1 parent
44d0693bfa
Exists in
master
and in
6 other branches
update code
Showing 3 changed files with 76 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
0d2deb4
... | ... | @@ -660,8 +660,10 @@ |
660 | 660 | return br; |
661 | 661 | } |
662 | 662 | //创建建档短信 |
663 | - createBuildSms(model); | |
663 | + //createBuildSms(model); | |
664 | 664 | |
665 | + createBuildMsg(model); | |
666 | + | |
665 | 667 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
666 | 668 | br.setErrormsg("成功"); |
667 | 669 | br.setData(model.getId()); |
... | ... | @@ -768,7 +770,7 @@ |
768 | 770 | |
769 | 771 | if (CollectionUtils.isNotEmpty(sendList)) { |
770 | 772 | //短信前缀 |
771 | - String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, babyModel.getBuildDoctor()); | |
773 | + String messagePrefix = smsConfigFacade.getMsgPrefix(configModel, babyModel.getBuildDoctor(),ServiceObjEnums.BABYOBJ.getId()); | |
772 | 774 | for (SmsTemplateModel templateModel : sendList) { |
773 | 775 | if (templateModel != null && templateModel.getStatus() == 1) { |
774 | 776 | ExceptionUtils.catchException("The child build status is opened.;" + babyModel.getMphone() + ";name=" + babyModel.getName()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
0d2deb4
... | ... | @@ -462,7 +462,9 @@ |
462 | 462 | |
463 | 463 | if (type == ServiceObjEnums.YUNOBJ.getId()) { |
464 | 464 | //生成建档短信 |
465 | - createBuildSms(p); | |
465 | +// createBuildSms(p); | |
466 | + | |
467 | + createBuildMsg(p); | |
466 | 468 | } |
467 | 469 | |
468 | 470 | |
... | ... | @@ -567,7 +569,7 @@ |
567 | 569 | if (CollectionUtils.isNotEmpty(sendList)) { |
568 | 570 | |
569 | 571 | //短信前缀 |
570 | - String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, patient.getBookbuildingDoctor()); | |
572 | + String messagePrefix = smsConfigFacade.getMsgPrefix(configModel, patient.getBookbuildingDoctor(), ServiceObjEnums.YUNOBJ.getId()); | |
571 | 573 | for (SmsTemplateModel templateModel : sendList) { |
572 | 574 | if (templateModel != null && templateModel.getStatus() == 1) { |
573 | 575 | com.lyms.platform.beans.MessageListRequest smsList = new com.lyms.platform.beans.MessageListRequest(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
View file @
0d2deb4
... | ... | @@ -814,6 +814,74 @@ |
814 | 814 | } |
815 | 815 | |
816 | 816 | |
817 | + | |
818 | + /** | |
819 | + * 获取发送短信的前缀 如果配置为发送科室前缀 就通过医生查询到医生所在科室 | |
820 | + * 然后取对应科室前缀 如果为空就取医院前缀 | |
821 | + * @return | |
822 | + */ | |
823 | + public String getMsgPrefix(SmsConfigModel config,String doctorId,int objType) | |
824 | + { | |
825 | + String prefix = ""; | |
826 | + //是否收费,孕妇,儿童,产妇 {"pregnant":"true","baby":"false","puerperant":"true"} | |
827 | + if (StringUtils.isNotEmpty(config.getIsCharge())) | |
828 | + { | |
829 | + prefix = config.getAreaPrefix(); | |
830 | + String isCharge = config.getIsCharge(); | |
831 | + Map<String,String> chargeMap = JsonUtil.getMap(isCharge); | |
832 | + if (chargeMap != null && chargeMap.size() > 0) | |
833 | + { | |
834 | + //孕妇 | |
835 | + if (objType == ServiceObjEnums.YUNOBJ.getId()) | |
836 | + { | |
837 | + String pregnant = chargeMap.get("pregnant"); | |
838 | + if (StringUtils.isNotEmpty(pregnant) && "true".equals(pregnant)) | |
839 | + { | |
840 | + prefix = getPrefix(config,doctorId); | |
841 | + } | |
842 | + } | |
843 | + //儿童 | |
844 | + else if (objType == ServiceObjEnums.BABYOBJ.getId()) | |
845 | + { | |
846 | + String baby = chargeMap.get("baby"); | |
847 | + if (StringUtils.isNotEmpty(baby) && "true".equals(baby)) | |
848 | + { | |
849 | + prefix = getPrefix(config,doctorId); | |
850 | + } | |
851 | + } | |
852 | + //产妇 | |
853 | + else if (objType == ServiceObjEnums.CHANOBJ.getId()) | |
854 | + { | |
855 | + String puerperant = chargeMap.get("puerperant"); | |
856 | + if (StringUtils.isNotEmpty(puerperant) && "true".equals(puerperant)) | |
857 | + { | |
858 | + prefix = getPrefix(config,doctorId); | |
859 | + } | |
860 | + } | |
861 | + } | |
862 | + } | |
863 | + return prefix; | |
864 | + } | |
865 | + | |
866 | + /** | |
867 | + * 获取医院前缀或者可是前缀 | |
868 | + * @param config | |
869 | + * @param doctorId | |
870 | + * @return | |
871 | + */ | |
872 | + private String getPrefix(SmsConfigModel config,String doctorId) | |
873 | + { | |
874 | + String messagePrefix = config.getHospitalPrefix(); | |
875 | + //前缀类型 0医院前缀 1科室前缀 | |
876 | + if (config.getPrefixType() != null && config.getPrefixType() == 1) | |
877 | + { | |
878 | + String res = getDeptPrefix(doctorId, config.getDeptPrefix()); | |
879 | + messagePrefix = res == "" ? messagePrefix : res; | |
880 | + } | |
881 | + return messagePrefix; | |
882 | + } | |
883 | + | |
884 | + | |
817 | 885 | /** |
818 | 886 | * 获取发送短信的前缀 如果配置为发送科室前缀 就通过医生查询到医生所在科室 |
819 | 887 | * 然后取对应科室前缀 如果为空就取医院前缀 |