提交 09cd46ef 作者: gh

客服排除error链接

上级 01d603b2
......@@ -233,8 +233,9 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
Map<Long, CrowdPackage> crowdPackageMap = crowdPackageList.stream().collect(Collectors.toMap(CrowdPackage::getId, a -> a));
LOCAL_LOG.info("start sendCustomerMessage");
for (CustomerGraphics customerGraphics : customerGraphicsList) {
LOCAL_LOG.info("{} start sendCustomerMessage:{}",customerGraphics.getId(),System.currentTimeMillis());
//人群包id
Long packId = customerGraphics.getPackId();
......@@ -271,9 +272,10 @@ public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMap
}
//客服状态修改
customerGraphics.setSendStatus(CustomerCommonConstant.SEND_STATUS_FINISHED);
LOCAL_LOG.info("{} finished:{}",customerGraphics.getId(),System.currentTimeMillis());
}
updateBatchById(customerGraphicsList);
LOCAL_LOG.info("end sendCustomerMessage");
}
}
......
package com.yaoyaozw.customer.service.wechat.service;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.client.utils.JSONUtils;
import com.yaoyaozw.customer.service.wechat.entity.WeChatResponseEntity;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
......@@ -70,18 +68,23 @@ public class WeChatRestService {
}
public <T>Object httpPostRequest(UriComponentsBuilder uriComponentsBuilder, Object requestEntity,Class<T> responseEntity)throws Exception{
HttpClient defaultHttpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(uriComponentsBuilder.toUriString());
httpPost.setHeader("Content-Type", "application/json;charset=utf-8");
if (requestEntity != null) {
//转换为json格式并打印
String json = JSONObject.toJSONString(requestEntity);
HttpEntity httpEntity = new StringEntity(json, "utf-8");
httpPost.setEntity(httpEntity);
}
HttpResponse httpResponse = defaultHttpClient.execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() != 200) {
String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode();
......@@ -98,4 +101,5 @@ public class WeChatRestService {
return JSONUtils.deserializeObject(s, responseEntity);
}
}
......@@ -104,8 +104,6 @@ public class WeChatServiceImpl implements WeChatService{
return sendCustomerDelayMessage(appid,tokenObject.toString(),user,delaySortMap,needUpdateVoList);
}
//token过期重新取一下
//AuthorizerToken updateToken = authorizerTokenService.findTokenByAppid(authorizerToken.getAuthorizerAppid());
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -41,7 +41,7 @@
on referral.account_id=authInfo.account_id
where referral.material_graphics_id=#{graphicsId} and referral.is_deleted=0 and referral.account_id is not null
where referral.material_graphics_id=#{graphicsId} and referral.is_deleted=0 and referral.account_id is not null and referral.referral!='error'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论