Forráskód Böngészése

Merge branch 'cpq-dev' of wangfan/adweb3-server into master

chenpeiqing 2 hónapja
szülő
commit
e62b0968d2

+ 15 - 20
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryService.java

@@ -1,38 +1,33 @@
 package org.jeecg.modules.adweb.enquiry.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-
+import java.util.List;
 import org.jeecg.modules.adweb.enquiry.dto.EnquiryDTO;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 
-import java.util.List;
-
 /**
- * @Description: 询盘信息存储表单
- * @Author: jeecg-boot
- * @Date: 2024-10-12
- * @Version: V1.0
+ * @Description: 询盘信息存储表单 @Author: jeecg-boot @Date: 2024-10-12 @Version: V1.0
  */
 public interface IAdwebEnquiryService extends IService<AdwebEnquiry> {
 
-    void addEnquiry(EnquiryDTO enquiryDTO, String plugin, List<AdwebSite> adwebSites);
+  void addEnquiry(EnquiryDTO enquiryDTO, String plugin, AdwebSite adwebSite);
 
-    /** 返回用户名称 */
-    void returnSalesperson(String siteCode, String inquiryId, String sales);
+  /** 返回用户名称 */
+  void returnSalesperson(String siteCode, String inquiryId, String sales);
 
-    /** 根据地区更新询盘跟进人 */
-    void updatePrincipalUidByRegion(Integer siteId);
+  /** 根据地区更新询盘跟进人 */
+  void updatePrincipalUidByRegion(Integer siteId);
 
-    /**
-     * 更改询盘用户有效性
-     *
-     * @return
-     */
-    boolean updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto);
+  /**
+   * 更改询盘用户有效性
+   *
+   * @return
+   */
+  boolean updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto);
 
-    void specialSendEmail(AdwebEnquiry adwebEnquiry, AdwebSite adwebSite);
+  void specialSendEmail(AdwebEnquiry adwebEnquiry, AdwebSite adwebSite);
 
-    List<EnquiryDTO> enquiryList(String siteCode, String startTime, String endTime);
+  List<EnquiryDTO> enquiryList(String siteCode, String startTime, String endTime);
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 647 - 521
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java


+ 19 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mq/EnquiryReceiver.java

@@ -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();

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott