Commit 7bb1996c16bee43ad0b2fa3a29fe720f78f809ee
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-common/src/main/java/com/lyms/platform/common/enums/WeekEnums.java
View file @
7bb1996
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java
View file @
7bb1996
| ... | ... | @@ -308,11 +308,11 @@ |
| 308 | 308 | for(MessageContent message : messageContents) |
| 309 | 309 | { |
| 310 | 310 | // //判断当前短信是否已经发送 通过短信ID和孕妇ID |
| 311 | -// boolean isExist = SaveMessageService.isExistSms(pat.getId(), message.getId()); | |
| 312 | -// if (isExist) | |
| 313 | -// { | |
| 314 | -// continue; | |
| 315 | -// } | |
| 311 | + boolean isExist = SaveMessageService.isExistSms(pat.getId(), message.getId()); | |
| 312 | + if (isExist) | |
| 313 | + { | |
| 314 | + continue; | |
| 315 | + } | |
| 316 | 316 | |
| 317 | 317 | String messageContent = "【"+messagePrefix+"】" + message.getContent(); |
| 318 | 318 | MessageRequest request = getMessageRequest( messageContent,pat.getPhone(),ServiceObjEnums.YUNOBJ.getId(), SmsServiceEnums.YBZD.getId(), |
platform-data-api/src/main/java/com/lyms/platform/data/util/SaveMessageService.java
View file @
7bb1996
| 1 | 1 | package com.lyms.platform.data.util; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.enums.ProjectTypeEnums; | |
| 3 | 4 | import com.lyms.platform.common.utils.HttpRequest; |
| 4 | 5 | import com.lyms.platform.common.utils.JsonUtil; |
| 5 | 6 | import com.lyms.platform.common.utils.PropertiesUtils; |
| 6 | 7 | import com.lyms.platform.common.utils.StringUtils; |
| 7 | 8 | import com.lyms.platform.data.pojo.MessageListRequest; |
| 8 | 9 | import com.lyms.platform.data.pojo.MessageRequest; |
| 10 | +import net.sf.json.JSONArray; | |
| 11 | +import net.sf.json.JSONObject; | |
| 9 | 12 | |
| 10 | 13 | import java.util.ArrayList; |
| 11 | 14 | import java.util.List; |
| 12 | 15 | |
| ... | ... | @@ -37,12 +40,17 @@ |
| 37 | 40 | |
| 38 | 41 | public static boolean isExistSms(String patientId,String tempId) |
| 39 | 42 | { |
| 40 | - String param = "patientId="+patientId+"&tempId="+tempId; | |
| 41 | - String result = HttpRequest.sendGet(CENTER_BASE_URL, param, CENTER_TOKEN); | |
| 42 | - if (StringUtils.isNotEmpty(result)) | |
| 43 | + | |
| 44 | + | |
| 45 | + String param = "typeId="+ ProjectTypeEnums.YNXT.getId()+"&ext2="+StringUtils.emptyStr(tempId)+"&ext3="+StringUtils.emptyStr(patientId)+"&page=1&limit=10"; | |
| 46 | + String result = HttpRequest.sendGet(CENTER_BASE_URL + "messages", param, CENTER_TOKEN); | |
| 47 | + | |
| 48 | + JSONObject jsonObject = JsonUtil.getObj(result); | |
| 49 | + if (jsonObject != null && jsonObject.getJSONArray("list") != null) | |
| 43 | 50 | { |
| 44 | - Map<String,String> map = JsonUtil.str2Obj(result, Map.class); | |
| 45 | - if ("0".equals(map.get("errorcode"))) | |
| 51 | + JSONArray jsonArray = jsonObject.getJSONArray("list"); | |
| 52 | + String list = jsonArray.toString(); | |
| 53 | + if (StringUtils.isNotEmpty(list) && !"[]".equals(list)) | |
| 46 | 54 | { |
| 47 | 55 | return true; |
| 48 | 56 | } |