Authored by unknown

update

... ... @@ -92,7 +92,7 @@ public class TLSendSMSServiceImpl implements ISendSMSService {
return mobileList;
}
}
log.warn("TLSendSMSServiceImpl error with content is {}, mobileList is {}, pair is {}", content, mobileList, pair);
log.warn("TLSendSMSServiceImpl error with content is {}, mobileList is {}, result is {}", content, mobileList, pair.getRight());
} catch (Exception e) {
log.error("TLSendSMSServiceImpl error with content is {}, mobileList is {}, e is {}", content, mobileList, e);
}
... ...
... ... @@ -60,12 +60,12 @@ public class WuXiSendSMSServiceImpl implements ISendSMSService {
Pair<Integer, String> pair = HttpUtils.httpPost(smsUrl, map, null, "UTF-8", 60000);
log.info("WuXiSendSMSServiceImpl pair: {}.", pair);
if (pair == null || pair.getLeft() != ErrorCodeEnum.SUCCESS.getCode()) {
log.warn("WuXiSendSMSServiceImpl send sms error with content is {}, mobileList is {}", content, mobileSendList);
log.warn("WuXiSendSMSServiceImpl send sms error with content is {}, mobileList is {},error is {}", content, mobileSendList,pair.getRight());
return null;
}
String right = pair.getRight();
if (StringUtils.isEmpty(right)) {
log.warn("WuXiSendSMSServiceImpl send sms error with content is {}, mobileList is {}", content, mobileSendList);
log.warn("WuXiSendSMSServiceImpl send sms with null errorMsg,content is {}, mobileList is {}", content, mobileSendList);
return null;
}
log.info("WuXiSendSMSServiceImpl.sendSms with result is {}",right);
... ... @@ -82,7 +82,7 @@ public class WuXiSendSMSServiceImpl implements ISendSMSService {
}
log.info("WuXiSendSMSServiceImpl end sendSMS with successSize is {},mobileSize is {},content is {}",successList.size(),mobileList.size(),content);
log.info("WuXiSendSMSServiceImpl end sendSMS with successSize is {},mobileSize is {},content is {}",successList,mobileList.size(),content);
SendNoticeResultBean bean = new SendNoticeResultBean();
bean.setSendNum(successList.size());
bean.setSuccessNum(successList.size());
... ...
... ... @@ -83,12 +83,12 @@ public class MiniServiceAppImpl implements IMiniAppService {
return new JSONObject();
}*/
if(filterSensitiveWordService.checkTestWord(reqBO.getData().toJSONString())){
logger.warn("sendMiniappMsg with sensitiveWord exist,reqBO is {}",reqBO);
logger.warn("sendMiniappMsg with sensitiveWord exist,uid is {},reqBO is {}",reqBO.getUid(),reqBO);
return new JSONObject();
}
if (StringUtils.isBlank(reqBO.getTemplateId())){
logger.warn("sendMiniappMsg template not exist, reqBO is {}", reqBO);
logger.warn("sendMiniappMsg template not exist, uid is {}, reqBO is {}",reqBO.getUid(), reqBO);
throw new ServiceException(ServiceError.WECHAT_PARAM_ISNULL);
}
... ... @@ -110,13 +110,13 @@ public class MiniServiceAppImpl implements IMiniAppService {
// token过期重新获取
if (result == null || result.getInteger("errcode") == 40001){
logger.info("retry send msg because error is {}, reqBO is {}", result.getInteger("errcode"), reqBO);
logger.warn("retry send msg because error is {}, uid is {},reqBO is {}", result != null ? result.toJSONString() : null, reqBO.getUid(), reqBO);
miniAppAccessTokenService.deletAccessToken(reqBO.getMiniappType());
return sendMsgUpdateDB(reqBO, miniappMsgForm);
}
// 过期的formId 和 不合法的formid
else if(result.getInteger("errcode") == 41028 || result.getInteger("errcode")== 41029){
logger.info("retry send msg because error is {}, reqBO is {}", result.getInteger("errcode"), reqBO);
logger.info("retry send msg because error is {}, uid is {},reqBO is {}", result.toJSONString(),reqBO.getUid(),reqBO);
miniappMsgForm.setAvailableTimes(0);
miniappMsgFormDAO.updateByPrimaryKey(miniappMsgForm);
... ... @@ -125,7 +125,7 @@ public class MiniServiceAppImpl implements IMiniAppService {
if (miniappMsgFormNew == null
|| StringUtils.isBlank(miniappMsgFormNew.getFormId())
|| StringUtils.isBlank(miniappMsgFormNew.getOpenId())){
logger.warn("validate form not exist, req is {}",reqBO);
logger.warn("validate form not exist, uid is {}, req is {}",reqBO.getUid(),reqBO);
return new JSONObject();
}
... ... @@ -204,7 +204,7 @@ public class MiniServiceAppImpl implements IMiniAppService {
}
logger.info("sendTemplateMsg begin with templateId is {}, url is {}, body is {}, uid is {}, ordercode is {}", reqBO.getTemplateId(),urlBuilder.toString(), JSONObject.toJSONString(bodyParam), reqBO.getUid(), reqBO.getOrderCode());
JSONObject result = WeChatUtils.httpRequest(urlBuilder.toString(), METHOD_POST, JSONObject.toJSONString(bodyParam));
miniSendLog.info("sendMiniappMsg end with templateId is {},body={}, result is {}", reqBO.getTemplateId(),JSONObject.toJSONString(bodyParam), JSONObject.toJSONString(result));
miniSendLog.info("sendMiniappMsg end with templateId is {},uid is {},body={}, result is {}", reqBO.getTemplateId(),reqBO.getUid(),JSONObject.toJSONString(bodyParam), JSONObject.toJSONString(result));
return result;
}
... ...
... ... @@ -107,18 +107,18 @@ public class WechatServiceImpl implements IWechatService {
JSONObject sendMsg = JSONObject.parseObject(data);
// 发送模板消息
try {
logger.info("send wechat template message {}, templateUrl is {}", sendMsg.toJSONString(), templateUrl);
logger.info("send wechat template message {}, openId is {}, templateUrl is {}", sendMsg.toJSONString(), wechatBO.getOpenid(),templateUrl);
JSONObject result = sendWechatRequest.sendWechatRequest(wechatBO.getPublicNumberCode(), templateUrl, "POST", sendMsg.toJSONString());
// 如果失败,重新调用接口获取access token再调用一次微信发送接口(有可能是我们消息中心redis中的access
// token失效),再失败则返回
if (result == null || result.getIntValue("errcode") != 0) {
logger.warn("send wechat template message error, sendMsg is {}, e is {}",sendMsg.toJSONString(), JSONObject.toJSONString(result) );
logger.warn("send wechat template message error, openId is {},sendMsg is {}, e is {}",wechatBO.getOpenid(),sendMsg.toJSONString(), JSONObject.toJSONString(result) );
// 重新调接口获取access token
AccessToken accessTokenNew = weixinAccessTokenService.getAccessTokenFromUrl(wechatBO.getPublicNumberCode());
templateUrl = this.getTemplateUrl(accessTokenNew,Consts.SEND_TEMPLATE_URL);
result = sendWechatRequest.sendWechatRequest(wechatBO.getPublicNumberCode(), templateUrl, "POST", sendMsg.toJSONString());
}
sendWechatMsgLog.info("send wechat template message {},result {}, templateUrl is {}", sendMsg.toJSONString(), result, templateUrl);
sendWechatMsgLog.info("send wechat template message {}, openId is {},result {}, templateUrl is {}", sendMsg.toJSONString(),wechatBO.getOpenid(),result, templateUrl);
} catch (Exception e) {
logger.warn("send wechat template msg fail,sendMsg is {}, e is {}", sendMsg.toJSONString(), e);
}
... ...