Commit 5d0a5ca1ec1877444a2b16624ddc2bd06d998322
1 parent
3aec2078
新增直播申请短信通知功能7
Showing
1 changed file
with
19 additions
and
16 deletions
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| @@ -139,12 +139,14 @@ public class LiveApplyJob { | @@ -139,12 +139,14 @@ public class LiveApplyJob { | ||
| 139 | noticeState = CommonConst.NOTICE_FAIL; | 139 | noticeState = CommonConst.NOTICE_FAIL; |
| 140 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; | 140 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result为空"; |
| 141 | i += 1; | 141 | i += 1; |
| 142 | + break; | ||
| 142 | } | 143 | } |
| 143 | Integer code = result.getInteger("errorCode"); | 144 | Integer code = result.getInteger("errorCode"); |
| 144 | if (code != 0) { | 145 | if (code != 0) { |
| 145 | noticeState = CommonConst.NOTICE_FAIL; | 146 | noticeState = CommonConst.NOTICE_FAIL; |
| 146 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); | 147 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,result返回消息为:" + result.getString("errorMessage"); |
| 147 | i += 1; | 148 | i += 1; |
| 149 | + break; | ||
| 148 | } else { | 150 | } else { |
| 149 | noticeState = CommonConst.NOTICE_SUCCESS; | 151 | noticeState = CommonConst.NOTICE_SUCCESS; |
| 150 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; | 152 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件" + emailAddr + "(" + shyEmail.getRemark() + ")发送成功"; |
| @@ -154,24 +156,25 @@ public class LiveApplyJob { | @@ -154,24 +156,25 @@ public class LiveApplyJob { | ||
| 154 | noticeState = CommonConst.NOTICE_FAIL; | 156 | noticeState = CommonConst.NOTICE_FAIL; |
| 155 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; | 157 | noticeMsg = noticeMsg + "\n" + dateTime + " 邮件服务器调用失败,服务器报错了"; |
| 156 | i += 1; | 158 | i += 1; |
| 157 | - } | ||
| 158 | - String taskId = "003_01"; | ||
| 159 | - String signatureId = "0"; | ||
| 160 | - Map<String, String> mobileparams = new HashMap<>(16); | ||
| 161 | - mobileparams.put("appId", appId); | ||
| 162 | - mobileparams.put("mobile", liveApply.getMobile()); | ||
| 163 | - mobileparams.put("content", content); | ||
| 164 | - mobileparams.put("taskId", taskId); | ||
| 165 | - mobileparams.put("signatureId", signatureId); | ||
| 166 | - httpUtil.setParamMap(mobileparams); | ||
| 167 | - if (i > 10) { | ||
| 168 | - Map<String, String> post = httpUtil.post(mobile_send_URL); | ||
| 169 | - logger.info("当前发送短信用户为:" + liveApply.getMobile() + ",发送短信的直播申请审核云id为:" + liveApply.getId() + "结果为:" + post.get("result")); | ||
| 170 | - noticeState = CommonConst.NOTICE_SUCCESS; | ||
| 171 | - noticeMsg = noticeMsg + "\n" + dateTime + "短信手机号" + liveApply.getMobile() + "(" + liveApply.getSender() + ")发送成功"; | ||
| 172 | - i = 0; | ||
| 173 | break; | 159 | break; |
| 174 | } | 160 | } |
| 161 | + //String taskId = "003_01"; | ||
| 162 | + //String signatureId = "0"; | ||
| 163 | + //Map<String, String> mobileparams = new HashMap<>(16); | ||
| 164 | + //mobileparams.put("appId", appId); | ||
| 165 | + //mobileparams.put("mobile", liveApply.getMobile()); | ||
| 166 | + //mobileparams.put("content", content); | ||
| 167 | + //mobileparams.put("taskId", taskId); | ||
| 168 | + //mobileparams.put("signatureId", signatureId); | ||
| 169 | + //httpUtil.setParamMap(mobileparams); | ||
| 170 | + //if (i > 4) { | ||
| 171 | + // Map<String, String> post = httpUtil.post(mobile_send_URL); | ||
| 172 | + // logger.info("当前发送短信用户为:" + liveApply.getMobile() + ",发送短信的直播申请审核云id为:" + liveApply.getId() + "结果为:" + post.get("result")); | ||
| 173 | + // noticeState = CommonConst.NOTICE_SUCCESS; | ||
| 174 | + // noticeMsg = noticeMsg + "\n" + dateTime + "短信手机号" + liveApply.getMobile() + "(" + liveApply.getSender() + ")发送成功"; | ||
| 175 | + // i = 0; | ||
| 176 | + // break; | ||
| 177 | + //} | ||
| 175 | } | 178 | } |
| 176 | liveApply.setEmail_notice_state(noticeState); | 179 | liveApply.setEmail_notice_state(noticeState); |
| 177 | liveApply.setEmail_notice_msg(noticeMsg); | 180 | liveApply.setEmail_notice_msg(noticeMsg); |