Commit 92c9d0bee9d3c6a1f696217467f7a0efb2e230fb
1 parent
9921ed15d6
Exists in
master
and in
1 other branch
code update
Showing 3 changed files with 19 additions and 11 deletions
platform-common/src/main/java/com/lyms/platform/common/enums/WeekEnums.java
View file @
92c9d0b
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java
View file @
92c9d0b
... | ... | @@ -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 @
92c9d0b
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 | } |