|
@@ -57,13 +57,13 @@ public class EnquiryReceiver extends BaseRabbiMqHandler<List<EnquiryDTO>> {
|
|
|
log.info("收到询盘MQ消息 {}", enquiries);
|
|
|
for (EnquiryDTO enquiry : enquiries) {
|
|
|
// 查看发布当前消息的站点是否是 adweb3 平台中绑定的是否是有效站点, 如果不是则直接确认消息,不做业务处理
|
|
|
- List<AdwebSite> adwebSites =
|
|
|
- adwebSiteService.list(
|
|
|
+ AdwebSite adwebSite =
|
|
|
+ adwebSiteService.getOne(
|
|
|
new LambdaQueryWrapper<AdwebSite>()
|
|
|
.like(AdwebSite::getDomain, enquiry.getSiteHost())
|
|
|
.ne(AdwebSite::getStatus, 0));
|
|
|
|
|
|
- if (adwebSites.isEmpty()) {
|
|
|
+ if (adwebSite == null) {
|
|
|
log.error("站点:{} 不是adweb3的有效绑定站点,MQ消息确认失败", enquiry.getSiteHost());
|
|
|
return;
|
|
|
}
|
|
@@ -97,7 +97,7 @@ public class EnquiryReceiver extends BaseRabbiMqHandler<List<EnquiryDTO>> {
|
|
|
long startTimeEnquiry = System.currentTimeMillis();
|
|
|
try {
|
|
|
// 询盘入库
|
|
|
- adwebEnquiryService.addEnquiry(enquiry, enquiry.getPluginName(), adwebSites);
|
|
|
+ adwebEnquiryService.addEnquiry(enquiry, enquiry.getPluginName(), adwebSite);
|
|
|
} catch (Exception e) {
|
|
|
log.error(
|
|
|
"站点:{},询盘ID:{},询盘入库异常:{}",
|
|
@@ -108,14 +108,28 @@ public class EnquiryReceiver extends BaseRabbiMqHandler<List<EnquiryDTO>> {
|
|
|
long endTimeEnquiry = System.currentTimeMillis();
|
|
|
long diffTime = endTimeEnquiry - startTime;
|
|
|
|
|
|
+ // 发送飞书告警
|
|
|
+ StringBuilder msg =
|
|
|
+ new StringBuilder(
|
|
|
+ "询盘异常,\n询盘id:"
|
|
|
+ + enquiry.getRecordId()
|
|
|
+ + ",\n站点名称:"
|
|
|
+ + adwebSite.getName()
|
|
|
+ + ",\n站点域名:"
|
|
|
+ + enquiry.getSiteHost()
|
|
|
+ + ",\n来源ip:"
|
|
|
+ + enquiry.getFromIp());
|
|
|
+
|
|
|
String className = this.getClass().getName();
|
|
|
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
|
|
|
+
|
|
|
+ msg.append(",\n字段异常,存在异常字段:").append(e.getMessage());
|
|
|
feishuService.sendEnquiryRobot(
|
|
|
(float) diffTime / 1000,
|
|
|
"MQ消费询盘失败:",
|
|
|
className,
|
|
|
methodName,
|
|
|
- "站点域名为:" + enquiry.getSiteHost() + " 的网站,询盘入库失败。 异常信息为:" + e.getMessage());
|
|
|
+ String.valueOf(msg));
|
|
|
}
|
|
|
// 记录结束时间
|
|
|
long endTimeEnquiry = System.currentTimeMillis();
|