Bladeren bron

Merge branch 'master' into dev-zenas-20241018

# Conflicts:
#	jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
zq940222 3 weken geleden
bovenliggende
commit
41e106ffc2
16 gewijzigde bestanden met toevoegingen van 1577 en 1417 verwijderingen
  1. BIN
      conf/adweb_v3.sql.zip
  2. 17 0
      conf/nginx/facebook-proxy.conf
  3. 855 704
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryController.java
  4. 20 23
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/EnquiryDTO.java
  5. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquiryForm.java
  6. 88 86
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java
  7. 335 403
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/entity/AdwebEnquiry.java
  8. 8 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/AdwebEnquiryMapper.java
  9. 7 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/xml/AdwebEnquiryMapper.xml
  10. 2 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryService.java
  11. 38 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java
  12. 0 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/controller/AdwebUserCountryController.java
  13. 2 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/xml/AdwebUserCountryMapper.xml
  14. 178 173
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/EmailSendMsgHandle.java
  15. 10 13
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/mapper/SysMessageTemplateMapper.java
  16. 3 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mq/EnquiryReceiver.java

BIN
conf/adweb_v3.sql.zip


+ 17 - 0
conf/nginx/facebook-proxy.conf

@@ -0,0 +1,17 @@
+server {
+    listen 80;
+    server_name facebook-proxy.adwebcloud.com;
+
+    location / {
+        proxy_pass https://graph.facebook.com/;
+        proxy_ssl_server_name on;
+        proxy_set_header Host graph.facebook.com;
+        proxy_set_header X-Forwarded-For $remote_addr;
+        proxy_set_header X-Forwarded-Proto $scheme;
+        proxy_http_version 1.1;
+
+        chunked_transfer_encoding off;
+        proxy_buffering off;
+        proxy_cache off;
+    }
+}

+ 855 - 704
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryController.java

@@ -1,7 +1,10 @@
 package org.jeecg.modules.adweb.enquiry.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.v3.oas.annotations.Operation;
@@ -27,11 +30,14 @@ import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.DictPropertyModel;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.FastJsonUtil;
+import org.jeecg.config.shiro.IgnoreAuth;
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.common.util.AwsTranslateUtils;
 import org.jeecg.modules.adweb.common.util.DateUtil;
 import org.jeecg.modules.adweb.enquiry.constant.EnquirySendStatus;
+import org.jeecg.modules.adweb.enquiry.dto.EnquiryDTO;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
+import org.jeecg.modules.adweb.enquiry.dto.param.EnquiryForm;
 import org.jeecg.modules.adweb.enquiry.dto.param.EnquiryListSearchDto;
 import org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto;
 import org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto;
@@ -40,6 +46,7 @@ import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import org.jeecg.modules.adweb.enquiry.entity.EnquiryEmailMessage;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryMapper;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
+import org.jeecg.modules.adweb.enquiry.service.IEnquiryEmailMessageService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
@@ -54,10 +61,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 /**
- * @Description: 询盘信息存储表单
- * @Author: jeecg-boot
- * @Date: 2024-10-12
- * @Version: V1.0
+ * @Description: 询盘信息存储表单 @Author: jeecg-boot @Date: 2024-10-12 @Version: V1.0
  */
 @Tag(name = "询盘信息存储表单")
 @RestController
@@ -65,711 +69,858 @@ import org.springframework.web.servlet.ModelAndView;
 @Slf4j
 public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdwebEnquiryService> {
 
-    @Value("${enquiry.disable-admin-read:true}")
-    private Boolean disableAdminRead;
-
-    @Value("${enquiry.demoFlag:false}")
-    private Boolean demoFlag;
-
-    @Resource private IAdwebEnquiryService adwebEnquiryService;
-
-    @Resource private AdwebEnquiryMapper adwebEnquiryMapper;
-
-    @Resource private SysAdwebApi sysAdwebApi;
-
-    @Resource private IAdwebSiteService adwebSiteService;
-
-    @Resource private ISiteUserPermissionService siteUserPermissionService;
-
-    @Resource private ISysDictService sysDictService;
-
-    @Resource private AwsTranslateUtils awsTranslateUtils;
-
-    @Resource private ISysUserService sysUserService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param searchDto
-     * @param pageNo
-     * @param pageSize
-     * @param principalUid
-     * @return
-     */
-    // @AutoLog(value = "询盘信息存储表单-分页列表查询")
-    @Operation(summary = "询盘信息存储表单-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<?> queryPageList(
-            EnquiryListSearchDto searchDto,
-            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-            String principalUid) {
-
-        if (sysAdwebApi.isNotOwnSite(searchDto.getSiteId())) {
-            return Result.OK(new Page<>());
-        }
-
-        Page<EnquirySearchDto> page = new Page<>(pageNo, pageSize);
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-
-        List<String> codeList = null;
-        List<String> uidList = null;
-
-        if (sysAdwebApi.isAdmin()) {
-
-        } else if (sysAdwebApi.isChannelAdmin()) {
-            uidList = sysAdwebApi.getChannelGroupUids();
-        } else {
-            uidList = new ArrayList<>();
-            uidList.add(sysUser.getId());
-        }
-        List<String> siteCodeList = null;
-        if (CollectionUtils.isNotEmpty(uidList)) {
-            siteCodeList = siteUserPermissionService.getSiteCodeListByUids(uidList);
-        }
-
-        if (searchDto.getSiteId() != null) {
-            String siteCode = adwebSiteService.getSiteCodeById(searchDto.getSiteId());
-            if (StringUtils.isNotBlank(siteCode)) {
-                LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper
-                        .eq(AdwebSite::getId, searchDto.getSiteId())
-                        .or()
-                        .eq(AdwebSite::getParentGroupCode, siteCode);
-                queryWrapper.ne(AdwebSite::getStatus, 0);
-                queryWrapper.in(!sysAdwebApi.isAdmin(), AdwebSite::getCode, siteCodeList);
-                codeList =
-                        adwebSiteService.list(queryWrapper).stream()
-                                .map(AdwebSite::getCode)
-                                .collect(Collectors.toList());
+  @Value("${enquiry.disable-admin-read:true}")
+  private Boolean disableAdminRead;
+
+  @Value("${enquiry.demoFlag:false}")
+  private Boolean demoFlag;
+
+  @Resource private IAdwebEnquiryService adwebEnquiryService;
+
+  @Resource private AdwebEnquiryMapper adwebEnquiryMapper;
+
+  @Resource private SysAdwebApi sysAdwebApi;
+
+  @Resource private IAdwebSiteService adwebSiteService;
+
+  @Resource private ISiteUserPermissionService siteUserPermissionService;
+
+  @Resource private ISysDictService sysDictService;
+
+  @Resource private AwsTranslateUtils awsTranslateUtils;
+
+  @Resource private ISysUserService sysUserService;
+
+  @Resource private IEnquiryEmailMessageService enquiryEmailMessageService;
+
+  /**
+   * 分页列表查询
+   *
+   * @param searchDto
+   * @param pageNo
+   * @param pageSize
+   * @param principalUid
+   * @return
+   */
+  // @AutoLog(value = "询盘信息存储表单-分页列表查询")
+  @Operation(summary = "询盘信息存储表单-分页列表查询")
+  @GetMapping(value = "/list")
+  public Result<?> queryPageList(
+      EnquiryListSearchDto searchDto,
+      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+      String principalUid) {
+
+    if (sysAdwebApi.isNotOwnSite(searchDto.getSiteId())) {
+      return Result.OK(new Page<>());
+    }
+
+    Page<EnquirySearchDto> page = new Page<>(pageNo, pageSize);
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+    List<String> codeList = null;
+    List<String> uidList = null;
+
+    if (sysAdwebApi.isAdmin()) {
+
+    } else if (sysAdwebApi.isChannelAdmin()) {
+      uidList = sysAdwebApi.getChannelGroupUids();
+    } else {
+      uidList = new ArrayList<>();
+      uidList.add(sysUser.getId());
+    }
+    List<String> siteCodeList = null;
+    if (CollectionUtils.isNotEmpty(uidList)) {
+      siteCodeList = siteUserPermissionService.getSiteCodeListByUids(uidList);
+    }
+
+    if (searchDto.getSiteId() != null) {
+      String siteCode = adwebSiteService.getSiteCodeById(searchDto.getSiteId());
+      if (StringUtils.isNotBlank(siteCode)) {
+        LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+            .eq(AdwebSite::getId, searchDto.getSiteId())
+            .or()
+            .eq(AdwebSite::getParentGroupCode, siteCode);
+        queryWrapper.ne(AdwebSite::getStatus, 0);
+        queryWrapper.in(!sysAdwebApi.isAdmin(), AdwebSite::getCode, siteCodeList);
+        codeList =
+            adwebSiteService.list(queryWrapper).stream()
+                .map(AdwebSite::getCode)
+                .collect(Collectors.toList());
+      }
+    } else {
+      codeList = siteCodeList;
+    }
+
+    String dateType = searchDto.getDateType();
+    Date start = searchDto.getStart();
+    Date end = searchDto.getEnd();
+    if (StringUtils.isNotBlank(dateType)) {
+      Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
+      start = dateRange.getLeft();
+      end = dateRange.getRight();
+    }
+
+    if (CollectionUtils.isEmpty(codeList)) {
+      return Result.OK(page);
+    }
+
+    String selfPrincipalUid = null;
+    if (sysAdwebApi.isAdwebSubVip()) {
+      selfPrincipalUid = sysUser.getId();
+    }
+
+    String userEfftecive = "(" + searchDto.getUserEffective() + ")";
+
+    IPage<EnquiryListDto> pageList =
+        adwebEnquiryMapper.selectEnquiryList(
+            page,
+            codeList,
+            userEfftecive,
+            searchDto.getWasteEnquiryType(),
+            searchDto.getSearchText(),
+            searchDto.getSearchContent(),
+            start,
+            end,
+            searchDto.getWhatsApp(),
+            searchDto.getReadStatus(),
+            principalUid,
+            selfPrincipalUid);
+
+    if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
+      dealInfo(pageList.getRecords());
+    }
+    return Result.OK(pageList);
+  }
+
+  /**
+   * 处理询盘列表结果集
+   *
+   * @param enquiryList
+   */
+  private void dealInfo(List<EnquiryListDto> enquiryList) {
+    if (CollectionUtils.isEmpty(enquiryList)) {
+      return;
+    }
+    List<DictModel> userEffectiveDict =
+        sysDictService.queryDictItemsByCode(AdwebConstant.ENQUIRY_EFFECTIVE);
+    AtomicInteger atomicInteger = new AtomicInteger();
+
+    enquiryList.forEach(
+        enquiry -> {
+          // 来源页面如果以 / 结尾,去掉最后一个字符
+          String fromPage = enquiry.getFromPage();
+          if (StringUtils.isNotBlank(fromPage)) {
+            if (fromPage.endsWith("/")) {
+              enquiry.setFromPage(fromPage.substring(0, fromPage.length() - 1));
             }
-        } else {
-            codeList = siteCodeList;
-        }
-
-        String dateType = searchDto.getDateType();
-        Date start = searchDto.getStart();
-        Date end = searchDto.getEnd();
-        if (StringUtils.isNotBlank(dateType)) {
-            Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
-            start = dateRange.getLeft();
-            end = dateRange.getRight();
-        }
-
-        if (CollectionUtils.isEmpty(codeList)) {
-            return Result.OK(page);
-        }
-
-        String selfPrincipalUid = null;
-        if (sysAdwebApi.isAdwebSubVip()) {
-            selfPrincipalUid = sysUser.getId();
-        }
-
-        String userEfftecive = "(" + searchDto.getUserEffective() + ")";
-
-        IPage<EnquiryListDto> pageList =
-                adwebEnquiryMapper.selectEnquiryList(
-                        page,
-                        codeList,
-                        userEfftecive,
-                        searchDto.getWasteEnquiryType(),
-                        searchDto.getSearchText(),
-                        searchDto.getSearchContent(),
-                        start,
-                        end,
-                        searchDto.getWhatsApp(),
-                        searchDto.getReadStatus(),
-                        principalUid,
-                        selfPrincipalUid);
-
-        if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
-            dealInfo(pageList.getRecords());
-        }
-        return Result.OK(pageList);
-    }
-
-    /**
-     * 处理询盘列表结果集
-     *
-     * @param enquiryList
-     */
-    private void dealInfo(List<EnquiryListDto> enquiryList) {
-        if (CollectionUtils.isEmpty(enquiryList)) {
-            return;
-        }
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<DictModel> userEffectiveDict =
-                sysDictService.queryDictItemsByCode(AdwebConstant.ENQUIRY_EFFECTIVE);
-        AtomicInteger atomicInteger = new AtomicInteger();
-
-        enquiryList.forEach(
-                enquiry -> {
-                    // 来源页面如果以 / 结尾,去掉最后一个字符
-                    String fromPage = enquiry.getFromPage();
-                    if (StringUtils.isNotBlank(fromPage)) {
-                        if (fromPage.endsWith("/")) {
-                            enquiry.setFromPage(fromPage.substring(0, fromPage.length() - 1));
-                        }
-                    }
-                    atomicInteger.getAndIncrement();
-                    enquiry.setDataIndex(atomicInteger.get());
-
-                    // 示例关键信息脱敏
-                    if (demoFlag) {
-                        enquiry.setFormCompany("**********");
-                        enquiry.setFromEmail("**********");
-                        enquiry.setWhatsApp("**********");
-                        enquiry.setPhone("**********");
-                        String siteName = enquiry.getSiteName();
-                        enquiry.setSiteName(
-                                siteName.substring(0, 2)
-                                        + "**********"
-                                        + siteName.substring(siteName.length() - 2));
-                    }
-
-                    /**********************字典数据处理***********************/
-                    if (CollectionUtils.isNotEmpty(userEffectiveDict)) {
-                        userEffectiveDict.forEach(
-                                dict -> {
-                                    if (dict.getValue().equals(enquiry.getUserEffective() + "")) {
-                                        enquiry.setUserEffectiveStr(dict.getLabel());
-                                    }
-                                });
-                    }
-
-                    // 询盘中用户自定义的字段处理
-                    if (StringUtils.isNotBlank(enquiry.getSpecialField())) {
-                        List<EnquirySpecialFields> specialFieldsList =
-                                FastJsonUtil.parseList(
-                                        enquiry.getSpecialField(), EnquirySpecialFields.class);
-                        enquiry.setSpecialFieldList(specialFieldsList);
-                        enquiry.setSpecialField(null);
-                    }
-
-                    if (StringUtils.isNotBlank(enquiry.getContext())) {
-                        String context = enquiry.getContext();
-                        Pattern CRLF = Pattern.compile("(\r\n|\r|\n|\n\r)");
-                        Matcher m = CRLF.matcher(context);
-                        if (m.find()) {
-                            context = m.replaceAll("<br/>");
-                        }
-                        enquiry.setContext(context);
-                    }
+          }
+          atomicInteger.getAndIncrement();
+          enquiry.setDataIndex(atomicInteger.get());
+
+          // 示例关键信息脱敏
+          if (demoFlag) {
+            enquiry.setFormCompany("**********");
+            enquiry.setFromEmail("**********");
+            enquiry.setWhatsApp("**********");
+            enquiry.setPhone("**********");
+            String siteName = enquiry.getSiteName();
+            enquiry.setSiteName(
+                siteName.substring(0, 2)
+                    + "**********"
+                    + siteName.substring(siteName.length() - 2));
+          }
+
+          /**********************字典数据处理***********************/
+          if (CollectionUtils.isNotEmpty(userEffectiveDict)) {
+            userEffectiveDict.forEach(
+                dict -> {
+                  if (dict.getValue().equals(enquiry.getUserEffective() + "")) {
+                    enquiry.setUserEffectiveStr(dict.getLabel());
+                  }
                 });
-    }
+          }
 
-    /**
-     * 添加
-     *
-     * @param adwebEnquiry
-     * @return
-     */
-    @AutoLog(value = "询盘信息存储表单-添加")
-    @Operation(summary = "询盘信息存储表单-添加")
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:add')")
-    @PostMapping(value = "/add")
-    public Result<String> add(@RequestBody AdwebEnquiry adwebEnquiry) {
-        adwebEnquiryService.save(adwebEnquiry);
-        return Result.OK("添加成功!");
-    }
-
-    /**
-     * 编辑
-     *
-     * @param adwebEnquiry
-     * @return
-     */
-    @AutoLog(value = "询盘信息存储表单-编辑")
-    @Operation(summary = "询盘信息存储表单-编辑")
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:edit')")
-    @RequestMapping(
-            value = "/edit",
-            method = {RequestMethod.PUT, RequestMethod.POST})
-    public Result<String> edit(@RequestBody AdwebEnquiry adwebEnquiry) {
-        adwebEnquiryService.updateById(adwebEnquiry);
-        return Result.OK("编辑成功!");
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "询盘信息存储表单-通过id删除")
-    @Operation(summary = "询盘信息存储表单-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:delete')")
-    @DeleteMapping(value = "/delete")
-    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
-        adwebEnquiryService.removeById(id);
-        return Result.OK("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "询盘信息存储表单-批量删除")
-    @Operation(summary = "询盘信息存储表单-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:deleteBatch')")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        this.adwebEnquiryService.removeByIds(Arrays.asList(ids.split(",")));
-        return Result.OK("批量删除成功!");
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    // @AutoLog(value = "询盘信息存储表单-通过id查询")
-    @Operation(summary = "询盘信息存储表单-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<AdwebEnquiry> queryById(@RequestParam(name = "id", required = true) String id) {
-        AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
-        if (adwebEnquiry == null) {
-            return Result.error("未找到对应数据");
-        }
-        return Result.OK(adwebEnquiry);
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param adwebEnquiry
-     */
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:exportXls')")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebEnquiry adwebEnquiry) {
-        return super.exportXls(request, adwebEnquiry, AdwebEnquiry.class, "询盘信息存储表单");
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:importExcel')")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, AdwebEnquiry.class);
-    }
-
-    /** 获取需要轮流询盘的站点code */
-    @GetMapping("/getTurnInquiryCode")
-    public Result<?> getTurnInquiryCode() {
-        List<DictPropertyModel> siteRes =
-                sysAdwebApi.queryDictInfoByDictCode("turn_inquiry_site_code");
-        if (CollectionUtils.isNotEmpty(siteRes)) {
-            return Result.OK(siteRes);
-        }
-        return null;
-    }
-
-    /**
-     * @return
-     */
-    @GetMapping(value = "/getEnquiryCatalog")
-    public Result<?> getEnquiryCatalog() {
-        List<DictPropertyModel> userEffectiveDict =
-                sysAdwebApi.queryDictInfoByDictCode(AdwebConstant.ENQUIRY_EFFECTIVE);
-        return Result.OK(FastJsonUtil.toJSONString(userEffectiveDict));
-    }
-
-    /**
-     * 获取不同状态询盘的数量
-     *
-     * @param siteId 站点id
-     * @return 数量信息
-     */
-    @GetMapping("getEnquiryNums")
-    public Result<?> getEnquiryNums(
-            Integer siteId,
-            String dateType,
-            @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
-            @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
-        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if (StringUtils.isNotBlank(dateType)) {
-            Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
-            start = dateRange.getLeft();
-            end = dateRange.getRight();
-        }
-
-        List<Integer> siteIds = null;
-        if (siteId != null) {
-            String siteCode = adwebSiteService.getSiteCodeById(siteId);
-            LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper
-                    .eq(AdwebSite::getCode, siteCode)
-                    .or()
-                    .eq(AdwebSite::getParentGroupCode, siteCode);
-            queryWrapper.ne(AdwebSite::getStatus, 0);
-            List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
-            siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
-        } else {
-            if (sysAdwebApi.isAdmin()) {
-                LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.ne(AdwebSite::getStatus, 0);
-                List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
-                siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
-            } else if (sysAdwebApi.isChannelAdmin()) {
-                List<String> channelGroupUids = sysAdwebApi.getChannelGroupUids();
-                List<String> codeList =
-                        siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
-                LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.in(AdwebSite::getCode, codeList);
-                queryWrapper.ne(AdwebSite::getStatus, 0);
-                List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
-                siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
-            } else {
-                List<String> codeList =
-                        siteUserPermissionService.getSiteCodeList(loginUser.getId());
-                LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.in(AdwebSite::getCode, codeList);
-                queryWrapper.ne(AdwebSite::getStatus, 0);
-                List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
-                siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+          enquiry.setPrincipalName("ALL");
+          if (StringUtils.isNotBlank(enquiry.getPrincipalUid())) {
+            SysUser sysUser = sysUserService.getById(enquiry.getPrincipalUid());
+            if (sysUser != null) {
+              enquiry.setPrincipalName(sysUser.getUsername());
             }
-        }
-
-        String principalUid = null;
-        if (sysAdwebApi.isAdwebSubVip()) {
-            principalUid = loginUser.getId();
-        }
-
-        LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper = new LambdaQueryWrapper<>();
-        enquiryQueryWrapper.eq(AdwebEnquiry::getStatus, 1);
-        if (start != null) {
-            enquiryQueryWrapper.ge(AdwebEnquiry::getRecordCtime, start);
-        }
-        if (end != null) {
-            enquiryQueryWrapper.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
-        }
-        if (siteIds != null) {
-            enquiryQueryWrapper.in(AdwebEnquiry::getSiteId, siteIds);
-        }
-        if (StringUtils.isNotBlank(principalUid)) {
-            String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper.and(
-                    wrapper ->
-                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
-                                    .or()
-                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
-        }
-        enquiryQueryWrapper.ne(AdwebEnquiry::getUserEffective, 0);
-        int all = (int) adwebEnquiryService.count(enquiryQueryWrapper);
-
-        LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper1 = new LambdaQueryWrapper<>();
-        enquiryQueryWrapper1.eq(AdwebEnquiry::getStatus, 1);
-        if (start != null) {
-            enquiryQueryWrapper1.ge(AdwebEnquiry::getRecordCtime, start);
-        }
-        if (end != null) {
-            enquiryQueryWrapper1.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
-        }
-        if (siteIds != null) {
-            enquiryQueryWrapper1.in(AdwebEnquiry::getSiteId, siteIds);
-        }
-        enquiryQueryWrapper1.eq(AdwebEnquiry::getReadStatus, 0);
-        if (StringUtils.isNotBlank(principalUid)) {
-            String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper1.and(
-                    wrapper ->
-                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
-                                    .or()
-                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
-        }
-        enquiryQueryWrapper1.ne(AdwebEnquiry::getUserEffective, 0);
-        int noRead = (int) adwebEnquiryService.count(enquiryQueryWrapper1);
-
-        LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper2 = new LambdaQueryWrapper<>();
-        enquiryQueryWrapper2.eq(AdwebEnquiry::getStatus, 1);
-        if (start != null) {
-            enquiryQueryWrapper2.ge(AdwebEnquiry::getRecordCtime, start);
-        }
-        if (end != null) {
-            enquiryQueryWrapper2.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
-        }
-        if (siteIds != null) {
-            enquiryQueryWrapper2.in(AdwebEnquiry::getSiteId, siteIds);
-        }
-        enquiryQueryWrapper2.eq(AdwebEnquiry::getUserEffective, 1);
-        if (StringUtils.isNotBlank(principalUid)) {
-            String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper2.and(
-                    wrapper ->
-                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
-                                    .or()
-                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
-        }
-        enquiryQueryWrapper2.ne(AdwebEnquiry::getUserEffective, 0);
-        int product = (int) adwebEnquiryService.count(enquiryQueryWrapper2);
-
-        LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper3 = new LambdaQueryWrapper<>();
-        enquiryQueryWrapper3.eq(AdwebEnquiry::getStatus, 1);
-        if (start != null) {
-            enquiryQueryWrapper3.ge(AdwebEnquiry::getRecordCtime, start);
-        }
-        if (end != null) {
-            enquiryQueryWrapper3.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
-        }
-        if (siteIds != null) {
-            enquiryQueryWrapper3.in(AdwebEnquiry::getSiteId, siteIds);
-        }
-        enquiryQueryWrapper3.eq(AdwebEnquiry::getUserEffective, 2);
-        if (StringUtils.isNotBlank(principalUid)) {
-            String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper3.and(
-                    wrapper ->
-                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
-                                    .or()
-                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
-        }
-        enquiryQueryWrapper3.ne(AdwebEnquiry::getUserEffective, 0);
-        int wait = (int) adwebEnquiryService.count(enquiryQueryWrapper3);
-
-        Map<String, Integer> map = new HashMap<>();
-        map.put("all", all);
-        map.put("noRead", noRead);
-        map.put("product", product);
-        map.put("wait", wait);
-
-        return Result.OK(map);
-    }
-
-    /**
-     * 将询盘的状态改为已读
-     *
-     * @param id 询盘id
-     * @return 处理结果
-     */
-    @GetMapping("/read")
-    public Result<?> read(@Param("id") String id) {
-        if (disableAdminRead && (sysAdwebApi.isAdmin() || sysAdwebApi.isChannelAdmin())) {
-            return Result.OK();
-        }
-        LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.in(AdwebEnquiry::getId, id);
-        updateWrapper.set(AdwebEnquiry::getReadStatus, 1);
-        adwebEnquiryService.update(updateWrapper);
-        return Result.OK();
-    }
-
-    /**
-     * @param query
-     * @return
-     */
-    @RequestMapping(value = "/enquiryTrans", method = RequestMethod.POST)
-    @ResponseBody
-    public Result<String> getEnquiryTrans(String query, String id) {
-        String text = awsTranslateUtils.translate(query);
-        LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(AdwebEnquiry::getId, id);
-        updateWrapper.set(AdwebEnquiry::getTransContent, text);
-        adwebEnquiryService.update(updateWrapper);
-
-        return Result.ok(text);
-    }
-
-    /** 更改询盘用户有效性 */
-    @PostMapping("/update/user/effective")
-    public Result<?> updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-
-        boolean res = adwebEnquiryService.updateUserEffective(effectiveEnquiryParamDto);
-        if (res) {
-            return Result.OK("ok");
-        }
-        return Result.error("fail");
-    }
-
-    /** 转发询盘 */
-    @AutoLog(value = "转发询盘")
-    @GetMapping(value = "/setForward")
-    public Result<?> setForward(
-            @RequestParam String ids, @RequestParam String uid, @RequestParam String code) {
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-
-        SysUser user = sysUserService.getById(uid);
-        if (StringUtils.isEmpty(user.getEmail())) {
-            return Result.error("该账户未设置邮箱!");
-        }
-        List<String> idList = Arrays.asList(ids.split(","));
-        LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.in(AdwebEnquiry::getId, idList);
-        updateWrapper.set(AdwebEnquiry::getPrincipalUid, uid);
-        updateWrapper.set(AdwebEnquiry::getPrincipalType, 1);
-        adwebEnquiryService.update(updateWrapper);
-
-        LambdaQueryWrapper<AdwebEnquiry> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.in(AdwebEnquiry::getId, idList);
-        List<AdwebEnquiry> list = adwebEnquiryService.list(queryWrapper);
-        // 获取站点
-        LambdaQueryWrapper<AdwebSite> adwebSiteQueryWrapper = new LambdaQueryWrapper<>();
-        adwebSiteQueryWrapper.eq(AdwebSite::getCode, code);
-        AdwebSite adwebSite = adwebSiteService.getOne(adwebSiteQueryWrapper);
-
-        // 返回跟进人名称
-        for (String id : idList) {
-            AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
-
-            adwebEnquiryService.specialSendEmail(adwebEnquiry, adwebSite);
-            if (adwebEnquiry != null && StringUtils.isNotBlank(adwebEnquiry.getRecordId())) {
-                adwebEnquiryService.returnSalesperson(
-                        code, adwebEnquiry.getRecordId(), user.getUsername());
+          }
+
+          // 询盘中用户自定义的字段处理
+          if (StringUtils.isNotBlank(enquiry.getSpecialField())) {
+            List<EnquirySpecialFields> specialFieldsList =
+                FastJsonUtil.parseList(enquiry.getSpecialField(), EnquirySpecialFields.class);
+            enquiry.setSpecialFieldList(specialFieldsList);
+            enquiry.setSpecialField(null);
+          }
+
+          if (StringUtils.isNotBlank(enquiry.getContext())) {
+            String context = enquiry.getContext();
+            Pattern CRLF = Pattern.compile("(\r\n|\r|\n|\n\r)");
+            Matcher m = CRLF.matcher(context);
+            if (m.find()) {
+              context = m.replaceAll("<br/>");
             }
-        }
-        return Result.OK();
-    }
-
-    /** 回收站列表接口 */
-    @AutoLog(value = "adweb_enquiry-分页列表查询")
-    @GetMapping(value = "/queryWasteEnquiryList")
-    public Result<?> queryWasteEnquiryList(
-            Integer siteId,
-            String searchText,
-            String enquiryType,
-            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-            @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize) {
-        if (sysAdwebApi.isNotOwnSite(siteId)) {
-            return Result.OK(new Page<>());
-        }
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        Page<EnquirySearchDto> page = new Page<>(pageNo, pageSize);
-        List<String> codeList = null;
-        List<String> uidList = null;
-
-        if (sysAdwebApi.isAdmin()) {
-        } else if (sysAdwebApi.isChannelAdmin()) {
-            uidList = sysAdwebApi.getChannelGroupUids();
-        } else {
-            uidList = new ArrayList<>();
-            uidList.add(sysUser.getId());
-        }
-
-        List<String> siteCodeList = null;
-        if (CollectionUtils.isNotEmpty(uidList)) {
-            siteCodeList = siteUserPermissionService.getSiteCodeListByUids(uidList);
-        }
+            enquiry.setContext(context);
+          }
+        });
+  }
+
+  /**
+   * 添加
+   *
+   * @param adwebEnquiry
+   * @return
+   */
+  @AutoLog(value = "询盘信息存储表单-添加")
+  @Operation(summary = "询盘信息存储表单-添加")
+  @PostMapping(value = "/add")
+  public Result<String> add(@RequestBody EnquiryForm enquiryForm) {
+    String defaultPlugin = "wpforms";
+
+    if (StringUtils.isBlank(enquiryForm.getSiteCode())) {
+      return Result.error("当前未选择站点");
+    }
 
-        codeList =
-                adwebSiteService
-                        .list(
-                                new LambdaQueryWrapper<AdwebSite>()
-                                        .eq(siteId != null, AdwebSite::getId, siteId)
-                                        .in(
-                                                !sysAdwebApi.isAdmin(),
-                                                AdwebSite::getCode,
-                                                siteCodeList)
-                                        .ne(AdwebSite::getStatus, 0))
-                        .stream()
-                        .map(AdwebSite::getCode)
-                        .collect(Collectors.toList());
-
-        String principalUid = null;
-        if (sysAdwebApi.isAdwebSubVip()) {
-            principalUid = sysUser.getId();
-        }
-        if (StringUtils.isNotBlank(searchText)) {
-            searchText = searchText.trim();
-        }
-        enquiryType = "(" + enquiryType + ")";
-        IPage<EnquiryListDto> pageList =
-                adwebEnquiryMapper.queryWasteEnquiryList(
-                        page,
-                        codeList,
-                        "",
-                        enquiryType,
-                        searchText,
-                        null,
-                        null,
-                        null,
-                        principalUid);
-        if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
-            dealInfo(pageList.getRecords());
-            return Result.OK(pageList);
-        }
-        dealInfo(pageList.getRecords());
-        return Result.OK(pageList);
-    }
-
-    /**
-     * 批量复原
-     *
-     * @param adwebEnquiry
-     * @return
-     */
-    @PutMapping(value = "/refreshBatch")
-    public Result<?> refreshBatch(@RequestBody AdwebEnquiry adwebEnquiry) {
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-
-        LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.in(AdwebEnquiry::getId, adwebEnquiry.getNo().split(","));
-        updateWrapper.set(AdwebEnquiry::getStatus, 1);
-        adwebEnquiryService.update(updateWrapper);
-
-        return Result.OK("批量复原成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param id 删除的询盘
-     * @return
-     */
-    @GetMapping(value = "/delBatch")
-    public Result<?> delBatch(@RequestParam("id") String id) {
-
-        LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.in(AdwebEnquiry::getId, id.split(","));
-        updateWrapper.set(AdwebEnquiry::getStatus, 0);
-        this.adwebEnquiryService.update(updateWrapper);
-        return Result.OK("批量删除成功!");
-    }
-
-    @GetMapping("/getWastedEnquiry")
-    public Result<List<EnquiryListDto>> getWastedEnquiry(
-            EnquiryListSearchDto enquiryListSearchDto) {
-
-        List<EnquiryListDto> wasterEnquiries =
-                adwebEnquiryMapper.getWastedEnquiry(
-                        enquiryListSearchDto.getWasteEnquiryType(),
-                        enquiryListSearchDto.getIp(),
-                        enquiryListSearchDto.getEmail(),
-                        enquiryListSearchDto.getKeyword(),
-                        enquiryListSearchDto.getSearchText(),
-                        enquiryListSearchDto.getType(),
-                        enquiryListSearchDto.getSiteId());
-
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-
-        return Result.OK(wasterEnquiries);
-    }
-
-    /**
-     * 根据询盘信息创建邮件发送记录
-     *
-     * @param adwebEnquiry 询盘信息
-     * @param email 接收邮箱
-     * @return
-     */
-    private static EnquiryEmailMessage newEmail(AdwebEnquiry adwebEnquiry, String email) {
-        EnquiryEmailMessage enquiryEmailMessage = new EnquiryEmailMessage();
-        enquiryEmailMessage.setEnquiryId(adwebEnquiry.getId());
-        enquiryEmailMessage.setEmail(email);
-        enquiryEmailMessage.setFromEmail(adwebEnquiry.getFromEmail());
-        enquiryEmailMessage.setCreateTime(new Date());
-        enquiryEmailMessage.setSiteCode(adwebEnquiry.getSiteCode());
-        enquiryEmailMessage.setSendStatus(EnquirySendStatus.WAIT_SEND);
-        enquiryEmailMessage.setSendErrorNum(0);
-
-        return enquiryEmailMessage;
+    QueryWrapper<AdwebSite> queryWrapper = new QueryWrapper<>();
+    queryWrapper
+        .ne("status", 0)
+        .in("create_type", Arrays.asList("manual", "wp"))
+        .eq("code", enquiryForm.getSiteCode());
+
+    AdwebSite adwebSite = adwebSiteService.getOne(queryWrapper);
+
+    String maxRecordId =
+        adwebEnquiryMapper.getMaxRecordIdByCode(adwebSite.getCode(), defaultPlugin);
+    if (StringUtils.isEmpty(maxRecordId)) {
+      maxRecordId = "1";
+    } else {
+      maxRecordId = String.valueOf((int) Double.parseDouble(maxRecordId) + 1);
+    }
+
+    JSONObject formObject = generateFormJsonObject(enquiryForm, adwebSite);
+    EnquiryDTO enquiryDTO = new EnquiryDTO();
+    enquiryDTO.setForms(formObject);
+    enquiryDTO.setFromIp("");
+    enquiryDTO.setFromEmail(enquiryForm.getEmail());
+    enquiryDTO.setFromSource(enquiryForm.getFromSource());
+    enquiryDTO.setCountryCode(enquiryForm.getCountryCode());
+    enquiryDTO.setPluginName(defaultPlugin);
+    enquiryDTO.setSiteHost(adwebSite.getDomain().replace("https://", ""));
+    enquiryDTO.setRecordCtime(new Date());
+    enquiryDTO.setRecordId(maxRecordId);
+    // 推送询盘
+    adwebEnquiryService.addEnquiry(enquiryDTO, defaultPlugin, adwebSite);
+    return Result.OK("添加成功!");
+  }
+
+  /**
+   * 编辑
+   *
+   * @param adwebEnquiry
+   * @return
+   */
+  @AutoLog(value = "询盘信息存储表单-编辑")
+  @Operation(summary = "询盘信息存储表单-编辑")
+  @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:edit')")
+  @RequestMapping(
+      value = "/edit",
+      method = {RequestMethod.PUT, RequestMethod.POST})
+  public Result<String> edit(@RequestBody AdwebEnquiry adwebEnquiry) {
+    adwebEnquiryService.updateById(adwebEnquiry);
+    return Result.OK("编辑成功!");
+  }
+
+  /**
+   * 通过id删除
+   *
+   * @param id
+   * @return
+   */
+  @AutoLog(value = "询盘信息存储表单-通过id删除")
+  @Operation(summary = "询盘信息存储表单-通过id删除")
+  @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:delete')")
+  @DeleteMapping(value = "/delete")
+  public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+    adwebEnquiryService.removeById(id);
+    return Result.OK("删除成功!");
+  }
+
+  /**
+   * 批量删除
+   *
+   * @param ids
+   * @return
+   */
+  @AutoLog(value = "询盘信息存储表单-批量删除")
+  @Operation(summary = "询盘信息存储表单-批量删除")
+  @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:deleteBatch')")
+  @DeleteMapping(value = "/deleteBatch")
+  public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+    this.adwebEnquiryService.removeByIds(Arrays.asList(ids.split(",")));
+    return Result.OK("批量删除成功!");
+  }
+
+  /**
+   * 通过id查询
+   *
+   * @param id
+   * @return
+   */
+  // @AutoLog(value = "询盘信息存储表单-通过id查询")
+  @Operation(summary = "询盘信息存储表单-通过id查询")
+  @GetMapping(value = "/queryById")
+  public Result<AdwebEnquiry> queryById(@RequestParam(name = "id", required = true) String id) {
+    AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
+    if (adwebEnquiry == null) {
+      return Result.error("未找到对应数据");
     }
+    return Result.OK(adwebEnquiry);
+  }
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param adwebEnquiry
+   */
+  @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:exportXls')")
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, AdwebEnquiry adwebEnquiry) {
+    return super.exportXls(request, adwebEnquiry, AdwebEnquiry.class, "询盘信息存储表单");
+  }
+
+  /**
+   * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:importExcel')")
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+    return super.importExcel(request, response, AdwebEnquiry.class);
+  }
+
+  /** 获取需要轮流询盘的站点code */
+  @GetMapping("/getTurnInquiryCode")
+  public Result<?> getTurnInquiryCode() {
+    List<DictPropertyModel> siteRes = sysAdwebApi.queryDictInfoByDictCode("turn_inquiry_site_code");
+    if (CollectionUtils.isNotEmpty(siteRes)) {
+      return Result.OK(siteRes);
+    }
+    return null;
+  }
+
+  /**
+   * @return
+   */
+  @GetMapping(value = "/getEnquiryCatalog")
+  public Result<?> getEnquiryCatalog() {
+    List<DictPropertyModel> userEffectiveDict =
+        sysAdwebApi.queryDictInfoByDictCode(AdwebConstant.ENQUIRY_EFFECTIVE);
+    return Result.OK(FastJsonUtil.toJSONString(userEffectiveDict));
+  }
+
+  /**
+   * 获取不同状态询盘的数量
+   *
+   * @param siteId 站点id
+   * @return 数量信息
+   */
+  @GetMapping("getEnquiryNums")
+  public Result<?> getEnquiryNums(
+      Integer siteId,
+      String dateType,
+      @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
+      @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
+    LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+    if (StringUtils.isNotBlank(dateType)) {
+      Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
+      start = dateRange.getLeft();
+      end = dateRange.getRight();
+    }
+
+    List<Integer> siteIds = null;
+    if (siteId != null) {
+      String siteCode = adwebSiteService.getSiteCodeById(siteId);
+      LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
+      queryWrapper
+          .eq(AdwebSite::getCode, siteCode)
+          .or()
+          .eq(AdwebSite::getParentGroupCode, siteCode);
+      queryWrapper.ne(AdwebSite::getStatus, 0);
+      List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+      siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+    } else {
+      if (sysAdwebApi.isAdmin()) {
+        LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.ne(AdwebSite::getStatus, 0);
+        List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+        siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+      } else if (sysAdwebApi.isChannelAdmin()) {
+        List<String> channelGroupUids = sysAdwebApi.getChannelGroupUids();
+        List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+        LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(AdwebSite::getCode, codeList);
+        queryWrapper.ne(AdwebSite::getStatus, 0);
+        List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+        siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+      } else {
+        List<String> codeList = siteUserPermissionService.getSiteCodeList(loginUser.getId());
+        LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(AdwebSite::getCode, codeList);
+        queryWrapper.ne(AdwebSite::getStatus, 0);
+        List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+        siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+      }
+    }
+
+    String principalUid = null;
+    if (sysAdwebApi.isAdwebSubVip()) {
+      principalUid = loginUser.getId();
+    }
+
+    LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper = new LambdaQueryWrapper<>();
+    enquiryQueryWrapper.eq(AdwebEnquiry::getStatus, 1);
+    if (start != null) {
+      enquiryQueryWrapper.ge(AdwebEnquiry::getRecordCtime, start);
+    }
+    if (end != null) {
+      enquiryQueryWrapper.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
+    }
+    if (siteIds != null) {
+      enquiryQueryWrapper.in(AdwebEnquiry::getSiteId, siteIds);
+    }
+    if (StringUtils.isNotBlank(principalUid)) {
+      String finalPrincipalUid = principalUid;
+      enquiryQueryWrapper.and(
+          wrapper ->
+              wrapper
+                  .eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                  .or()
+                  .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+    }
+    enquiryQueryWrapper.ne(AdwebEnquiry::getUserEffective, 0);
+    int all = (int) adwebEnquiryService.count(enquiryQueryWrapper);
+
+    LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper1 = new LambdaQueryWrapper<>();
+    enquiryQueryWrapper1.eq(AdwebEnquiry::getStatus, 1);
+    if (start != null) {
+      enquiryQueryWrapper1.ge(AdwebEnquiry::getRecordCtime, start);
+    }
+    if (end != null) {
+      enquiryQueryWrapper1.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
+    }
+    if (siteIds != null) {
+      enquiryQueryWrapper1.in(AdwebEnquiry::getSiteId, siteIds);
+    }
+    enquiryQueryWrapper1.eq(AdwebEnquiry::getReadStatus, 0);
+    if (StringUtils.isNotBlank(principalUid)) {
+      String finalPrincipalUid = principalUid;
+      enquiryQueryWrapper1.and(
+          wrapper ->
+              wrapper
+                  .eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                  .or()
+                  .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+    }
+    enquiryQueryWrapper1.ne(AdwebEnquiry::getUserEffective, 0);
+    int noRead = (int) adwebEnquiryService.count(enquiryQueryWrapper1);
+
+    LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper2 = new LambdaQueryWrapper<>();
+    enquiryQueryWrapper2.eq(AdwebEnquiry::getStatus, 1);
+    if (start != null) {
+      enquiryQueryWrapper2.ge(AdwebEnquiry::getRecordCtime, start);
+    }
+    if (end != null) {
+      enquiryQueryWrapper2.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
+    }
+    if (siteIds != null) {
+      enquiryQueryWrapper2.in(AdwebEnquiry::getSiteId, siteIds);
+    }
+    enquiryQueryWrapper2.eq(AdwebEnquiry::getUserEffective, 1);
+    if (StringUtils.isNotBlank(principalUid)) {
+      String finalPrincipalUid = principalUid;
+      enquiryQueryWrapper2.and(
+          wrapper ->
+              wrapper
+                  .eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                  .or()
+                  .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+    }
+    enquiryQueryWrapper2.ne(AdwebEnquiry::getUserEffective, 0);
+    int product = (int) adwebEnquiryService.count(enquiryQueryWrapper2);
+
+    LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper3 = new LambdaQueryWrapper<>();
+    enquiryQueryWrapper3.eq(AdwebEnquiry::getStatus, 1);
+    if (start != null) {
+      enquiryQueryWrapper3.ge(AdwebEnquiry::getRecordCtime, start);
+    }
+    if (end != null) {
+      enquiryQueryWrapper3.lt(AdwebEnquiry::getRecordCtime, DateUtil.addDays(end, 1));
+    }
+    if (siteIds != null) {
+      enquiryQueryWrapper3.in(AdwebEnquiry::getSiteId, siteIds);
+    }
+    enquiryQueryWrapper3.eq(AdwebEnquiry::getUserEffective, 2);
+    if (StringUtils.isNotBlank(principalUid)) {
+      String finalPrincipalUid = principalUid;
+      enquiryQueryWrapper3.and(
+          wrapper ->
+              wrapper
+                  .eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                  .or()
+                  .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+    }
+    enquiryQueryWrapper3.ne(AdwebEnquiry::getUserEffective, 0);
+    int wait = (int) adwebEnquiryService.count(enquiryQueryWrapper3);
+
+    Map<String, Integer> map = new HashMap<>();
+    map.put("all", all);
+    map.put("noRead", noRead);
+    map.put("product", product);
+    map.put("wait", wait);
+
+    return Result.OK(map);
+  }
+
+  /**
+   * 将询盘的状态改为已读
+   *
+   * @param id 询盘id
+   * @return 处理结果
+   */
+  @GetMapping("/read")
+  public Result<?> read(@Param("id") String id) {
+    if (disableAdminRead && (sysAdwebApi.isAdmin() || sysAdwebApi.isChannelAdmin())) {
+      return Result.OK();
+    }
+    LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
+    updateWrapper.in(AdwebEnquiry::getId, id);
+    updateWrapper.set(AdwebEnquiry::getReadStatus, 1);
+    adwebEnquiryService.update(updateWrapper);
+    return Result.OK();
+  }
+
+  @AutoLog(value = "编辑询盘的负责人")
+  @GetMapping(value = "/setPrincipal")
+  public Result<?> setPrincipal(@RequestParam String productId, @RequestParam String uid) {
+
+    UpdateWrapper<AdwebEnquiry> updateWrapper = new UpdateWrapper<>();
+    updateWrapper.eq("id", productId);
+    updateWrapper.set("principal_uid", uid);
+    updateWrapper.set("principal_type", 1);
+    adwebEnquiryService.update(updateWrapper);
+
+    AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(productId);
+    if (adwebEnquiry.getUserEffective() != 0) {
+      // 添加负责人发送询盘邮件并发送
+      Result<?> result = enquiryEmailMessageService.addAndEnquiryEmailMsg(adwebEnquiry, uid);
+      if (!result.isSuccess()) {
+        log.error("询盘邮件存入或发送失败,原因:负责人可能没有邮箱!");
+      }
+
+      return result;
+    }
+    return Result.OK();
+  }
+
+  /**
+   * @param query
+   * @return
+   */
+  @RequestMapping(value = "/enquiryTrans", method = RequestMethod.POST)
+  @ResponseBody
+  public Result<String> getEnquiryTrans(String query, String id) {
+    String text = awsTranslateUtils.translate(query);
+    LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
+    updateWrapper.eq(AdwebEnquiry::getId, id);
+    updateWrapper.set(AdwebEnquiry::getTransContent, text);
+    adwebEnquiryService.update(updateWrapper);
+
+    return Result.ok(text);
+  }
+
+  /** 更改询盘用户有效性 */
+  @PostMapping("/update/user/effective")
+  public Result<?> updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+    boolean res = adwebEnquiryService.updateUserEffective(effectiveEnquiryParamDto);
+    if (res) {
+      return Result.OK("ok");
+    }
+    return Result.error("fail");
+  }
+
+  /** 转发询盘 */
+  @AutoLog(value = "转发询盘")
+  @GetMapping(value = "/setForward")
+  public Result<?> setForward(
+      @RequestParam String ids, @RequestParam String uid, @RequestParam String code) {
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+    SysUser user = sysUserService.getById(uid);
+    if (StringUtils.isEmpty(user.getEmail())) {
+      return Result.error("该账户未设置邮箱!");
+    }
+    List<String> idList = Arrays.asList(ids.split(","));
+    LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
+    updateWrapper.in(AdwebEnquiry::getId, idList);
+    updateWrapper.set(AdwebEnquiry::getPrincipalUid, uid);
+    updateWrapper.set(AdwebEnquiry::getPrincipalType, 1);
+    adwebEnquiryService.update(updateWrapper);
+
+    LambdaQueryWrapper<AdwebEnquiry> queryWrapper = new LambdaQueryWrapper<>();
+    queryWrapper.in(AdwebEnquiry::getId, idList);
+    List<AdwebEnquiry> list = adwebEnquiryService.list(queryWrapper);
+    // 获取站点
+    LambdaQueryWrapper<AdwebSite> adwebSiteQueryWrapper = new LambdaQueryWrapper<>();
+    adwebSiteQueryWrapper.eq(AdwebSite::getCode, code);
+    AdwebSite adwebSite = adwebSiteService.getOne(adwebSiteQueryWrapper);
+
+    // 返回跟进人名称
+    for (String id : idList) {
+      AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
+
+      adwebEnquiryService.specialSendEmail(adwebEnquiry, adwebSite);
+      if (adwebEnquiry != null && StringUtils.isNotBlank(adwebEnquiry.getRecordId())) {
+        adwebEnquiryService.returnSalesperson(code, adwebEnquiry.getRecordId(), user.getUsername());
+      }
+    }
+    return Result.OK();
+  }
+
+  /** 回收站列表接口 */
+  @AutoLog(value = "adweb_enquiry-分页列表查询")
+  @GetMapping(value = "/queryWasteEnquiryList")
+  public Result<?> queryWasteEnquiryList(
+      Integer siteId,
+      String searchText,
+      String enquiryType,
+      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+      @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize) {
+    if (sysAdwebApi.isNotOwnSite(siteId)) {
+      return Result.OK(new Page<>());
+    }
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+    Page<EnquirySearchDto> page = new Page<>(pageNo, pageSize);
+    List<String> codeList = null;
+    List<String> uidList = null;
+
+    if (sysAdwebApi.isAdmin()) {
+    } else if (sysAdwebApi.isChannelAdmin()) {
+      uidList = sysAdwebApi.getChannelGroupUids();
+    } else {
+      uidList = new ArrayList<>();
+      uidList.add(sysUser.getId());
+    }
+
+    List<String> siteCodeList = null;
+    if (CollectionUtils.isNotEmpty(uidList)) {
+      siteCodeList = siteUserPermissionService.getSiteCodeListByUids(uidList);
+    }
+
+    codeList =
+        adwebSiteService
+            .list(
+                new LambdaQueryWrapper<AdwebSite>()
+                    .eq(siteId != null, AdwebSite::getId, siteId)
+                    .in(!sysAdwebApi.isAdmin(), AdwebSite::getCode, siteCodeList)
+                    .ne(AdwebSite::getStatus, 0))
+            .stream()
+            .map(AdwebSite::getCode)
+            .collect(Collectors.toList());
+
+    String principalUid = null;
+    if (sysAdwebApi.isAdwebSubVip()) {
+      principalUid = sysUser.getId();
+    }
+    if (StringUtils.isNotBlank(searchText)) {
+      searchText = searchText.trim();
+    }
+    enquiryType = "(" + enquiryType + ")";
+    IPage<EnquiryListDto> pageList =
+        adwebEnquiryMapper.queryWasteEnquiryList(
+            page, codeList, "", enquiryType, searchText, null, null, null, principalUid);
+    if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
+      dealInfo(pageList.getRecords());
+      return Result.OK(pageList);
+    }
+    dealInfo(pageList.getRecords());
+    return Result.OK(pageList);
+  }
+
+  /**
+   * 批量复原
+   *
+   * @param adwebEnquiry
+   * @return
+   */
+  @PutMapping(value = "/refreshBatch")
+  public Result<?> refreshBatch(@RequestBody AdwebEnquiry adwebEnquiry) {
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+    LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
+    updateWrapper.in(AdwebEnquiry::getId, adwebEnquiry.getNo().split(","));
+    updateWrapper.set(AdwebEnquiry::getStatus, 1);
+    adwebEnquiryService.update(updateWrapper);
+
+    return Result.OK("批量复原成功!");
+  }
+
+  /**
+   * 批量删除
+   *
+   * @param id 删除的询盘
+   * @return
+   */
+  @GetMapping(value = "/delBatch")
+  public Result<?> delBatch(@RequestParam("id") String id) {
+
+    LambdaUpdateWrapper<AdwebEnquiry> updateWrapper = new LambdaUpdateWrapper<>();
+    updateWrapper.in(AdwebEnquiry::getId, id.split(","));
+    updateWrapper.set(AdwebEnquiry::getStatus, 0);
+    this.adwebEnquiryService.update(updateWrapper);
+    return Result.OK("批量删除成功!");
+  }
+
+  @GetMapping("/getWastedEnquiry")
+  public Result<List<EnquiryListDto>> getWastedEnquiry(EnquiryListSearchDto enquiryListSearchDto) {
+
+    List<EnquiryListDto> wasterEnquiries =
+        adwebEnquiryMapper.getWastedEnquiry(
+            enquiryListSearchDto.getWasteEnquiryType(),
+            enquiryListSearchDto.getIp(),
+            enquiryListSearchDto.getEmail(),
+            enquiryListSearchDto.getKeyword(),
+            enquiryListSearchDto.getSearchText(),
+            enquiryListSearchDto.getType(),
+            enquiryListSearchDto.getSiteId());
+
+    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+    return Result.OK(wasterEnquiries);
+  }
+
+  // 本地开发环境测试询盘同步,从远程站点拉取询盘到开发数据库
+  @IgnoreAuth
+  @GetMapping("local_test_enquiryNotify")
+  public Result<?> enquiryNotifyss(
+      @RequestParam(name = "siteCodeJobParam", required = false) String siteCodeJobParam,
+      @RequestParam(name = "siteRecodeId", required = false) String siteRecodeId) {
+
+    if (StringUtils.isBlank(siteCodeJobParam)) {
+      return Result.error("请输入站点code");
+    }
+
+    if (StringUtils.isBlank(siteRecodeId)) {
+      return Result.error("站点询盘记录ID");
+    }
+
+    QueryWrapper<AdwebSite> queryWrapper = new QueryWrapper<>();
+    queryWrapper
+        .ne("status", 0)
+        .in("create_type", Arrays.asList("manual", "wp"))
+        .eq("code", siteCodeJobParam);
+
+    List<AdwebSite> siteList = adwebSiteService.list(queryWrapper);
+
+    if (siteList.isEmpty()) {
+      return Result.error("当前站点不存在");
+    }
+
+    String jsonString =
+        "{\"1\":{\"name\":\"Name\",\"value\":\"chen peiqing\",\"id\":1,\"type\":\"text\"},\"2\":{\"name\":\"Email\",\"value\":\"chenpeiqing.1393599253@live.com\",\"id\":2,\"type\":\"email\"},\"3\":{\"name\":\"Phone\",\"value\":\"13223012703\",\"id\":3,\"type\":\"phone\"},\"4\":{\"name\":\"Message\",\"value\":\"tets\",\"id\":4,\"type\":\"textarea\"},\"5\":{\"name\":\"Customer IP\",\"value\":\"::1\",\"id\":5,\"type\":\"hidden\"},\"6\":{\"name\":\"From Page\",\"value\":\"http:\\/\\/wp063.cpq\\/products\\/occupancy-product-3\\/\",\"id\":6,\"type\":\"hidden\"}}";
+
+    JSONObject object = FastJsonUtil.parseObject(jsonString, JSONObject.class);
+    EnquiryDTO adwebEnquiry = new EnquiryDTO();
+    adwebEnquiry.setForms(object);
+    adwebEnquiry.setFromEmail("chenpeiqing.1393599253@dfd.com");
+    adwebEnquiry.setFromIp("107.182.184.127");
+    adwebEnquiry.setPluginName("wpforms");
+    adwebEnquiry.setSiteHost("20250219i96eui.v3-site.adwebcloud.com");
+    adwebEnquiry.setRecordCtime(new Date("Tue Feb 25 03:31:37 UTC 2025"));
+    adwebEnquiry.setRecordId(siteRecodeId);
+    // 模拟mq推送询盘
+    adwebEnquiryService.addEnquiry(adwebEnquiry, adwebEnquiry.getPluginName(), siteList.get(0));
+
+    return Result.OK(true);
+  }
+
+  /**
+   * 根据询盘信息创建邮件发送记录
+   *
+   * @param adwebEnquiry 询盘信息
+   * @param email 接收邮箱
+   * @return
+   */
+  private static EnquiryEmailMessage newEmail(AdwebEnquiry adwebEnquiry, String email) {
+    EnquiryEmailMessage enquiryEmailMessage = new EnquiryEmailMessage();
+    enquiryEmailMessage.setEnquiryId(adwebEnquiry.getId());
+    enquiryEmailMessage.setEmail(email);
+    enquiryEmailMessage.setFromEmail(adwebEnquiry.getFromEmail());
+    enquiryEmailMessage.setCreateTime(new Date());
+    enquiryEmailMessage.setSiteCode(adwebEnquiry.getSiteCode());
+    enquiryEmailMessage.setSendStatus(EnquirySendStatus.WAIT_SEND);
+    enquiryEmailMessage.setSendErrorNum(0);
+
+    return enquiryEmailMessage;
+  }
+
+  private static JSONObject generateFormJsonObject(EnquiryForm adwebEnquiry, AdwebSite adwebSite) {
+    // 创建外层json
+    JSONObject outObject = new JSONObject();
+
+    // 创建内容json
+    JSONObject object1 = new JSONObject();
+    object1.put("name", "Name");
+    object1.put("value", adwebEnquiry.getName());
+    object1.put("id", "1");
+    object1.put("type", "text");
+    outObject.put("1", object1);
+
+    JSONObject object2 = new JSONObject();
+    object2.put("name", "Email");
+    object2.put("value", adwebEnquiry.getEmail());
+    object2.put("id", "2");
+    object2.put("type", "email");
+    outObject.put("2", object2);
+
+    JSONObject object3 = new JSONObject();
+    object3.put("name", "Phone");
+    object3.put("value", adwebEnquiry.getPhone());
+    object3.put("id", "3");
+    object3.put("type", "phone");
+    outObject.put("3", object3);
+
+    JSONObject object4 = new JSONObject();
+    object4.put("name", "Message");
+    object4.put("value", adwebEnquiry.getMessage());
+    object4.put("id", "4");
+    object4.put("type", "textarea");
+    outObject.put("4", object4);
+
+    JSONObject object5 = new JSONObject();
+    object5.put("name", "Customer IP");
+    object5.put("value", "::1");
+    object5.put("id", "5");
+    object5.put("type", "hidden");
+    outObject.put("5", object5);
+
+    JSONObject object6 = new JSONObject();
+    object6.put("name", "From Page");
+    object6.put("value", adwebSite.getDomain());
+    object6.put("id", "6");
+    object6.put("type", "hidden");
+    outObject.put("6", object6);
+
+    return outObject;
+  }
 }

+ 20 - 23
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/EnquiryDTO.java

@@ -1,36 +1,33 @@
 package org.jeecg.modules.adweb.enquiry.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
-
-import lombok.Data;
-
 import java.util.Date;
+import lombok.Data;
 
 /**
  * @author wfansh
  */
 @Data
 public class EnquiryDTO {
-    // 站点code,关联站点表
-    private String siteCode;
-    private String fromEmail;
-    private Object forms;
-    private String pluginName;
-    private String fromIp;
-    private String siteHost;
+  // 站点code,关联站点表
+  private String siteCode;
+  private String fromEmail;
+  private Object forms;
+  private String pluginName;
+  private String fromIp;
+  private String siteHost;
 
-    @JsonFormat(
-            shape = JsonFormat.Shape.STRING,
-            timezone = "GMT+8",
-            pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date recordCtime;
+  @JsonFormat(shape = JsonFormat.Shape.STRING, timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  private Date recordCtime;
 
-    private String recordId;
-    // 访问人id
-    private String visitId;
-    // 站点id
-    private Integer siteId;
-    private String siteToken;
-    private String formName;
-    private Object cartItems;
+  private String recordId;
+  // 访问人id
+  private String visitId;
+  // 站点id
+  private Integer siteId;
+  private String siteToken;
+  private String formName;
+  private Object cartItems;
+  private String countryCode;
+  private String fromSource;
 }

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquiryForm.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.adweb.enquiry.dto.param;
+
+import lombok.Data;
+
+@Data
+public class EnquiryForm {
+  private String name;
+  private String email;
+  private String siteCode;
+  private String countryCode;
+  private String fromSource;
+  private String phone;
+  private String message;
+}

+ 88 - 86
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java

@@ -9,90 +9,92 @@ import java.util.List;
 
 @Data
 public class EnquiryListDto {
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
-
-    // 询盘编号(系统生成)
-    private String no;
-    private String noOut;
-    // 询盘创建时间(发起时间)
-    private Date recordCtime;
-    // 询盘入库时间
-    private Date ctime;
-    // 询盘业务模块
-    private String modular;
-    // 询盘联系人
-    private String contact;
-    // 询盘内容
-    private String context;
-    // 询盘发送邮箱
-    private String fromEmail;
-    // 国家/地区
-    private String country;
-    // 发送询盘的站点
-    private String siteHost;
-    // 用户有效性
-    private Integer userEffective;
-    // 回复状态
-    private String replayStatus;
-    private Integer status;
-    private Integer siteId;
-    private String siteCode;
-
-    private List<String> job;
-    // 简历路径
-    private String path;
-
-    /** 后台处理字段 */
-
-    // 来源页面
-    private String fromPage;
-
-    // 电话
-    private String phone;
-    // 表单公司
-    private String formCompany;
-    // 用户有效性
-    private String userEffectiveStr;
-    // 敏感词
-    private String sensitiveMessage;
-    // 系统有效性
-    private Integer sysEffective;
-    private String siteName;
-    private String transContent;
-    private String cartItems;
-
-    /** 用于前端默认展示第一行数据 */
-    private Integer dataIndex;
-
-    private String whatsApp;
-
-    private String wasteEnquiry;
-
-    private String countryName;
-
-    private String countryCode;
-
-    private Integer readStatus;
-
-    private String fromIp;
-
-    private String customerIp;
-
-    private String visitId;
-
-    private String principalUid;
-
-    /** 特殊字段名 */
-    private String specialField;
-
-    private List<EnquirySpecialFields> specialFieldList;
-
-    /** 疑似垃圾询盘理由 */
-    private String effectiveReason;
-
-    /** 询盘来源插件名称 */
-    private String pluginName;
-
-    private String wasteEnquiryType;
+  @JsonSerialize(using = ToStringSerializer.class)
+  private Long id;
+
+  // 询盘编号(系统生成)
+  private String no;
+  private String noOut;
+  // 询盘创建时间(发起时间)
+  private Date recordCtime;
+  // 询盘入库时间
+  private Date ctime;
+  // 询盘业务模块
+  private String modular;
+  // 询盘联系人
+  private String contact;
+  // 询盘内容
+  private String context;
+  // 询盘发送邮箱
+  private String fromEmail;
+  // 国家/地区
+  private String country;
+  // 发送询盘的站点
+  private String siteHost;
+  // 用户有效性
+  private Integer userEffective;
+  // 回复状态
+  private String replayStatus;
+  private Integer status;
+  private Integer siteId;
+  private String siteCode;
+
+  private List<String> job;
+  // 简历路径
+  private String path;
+
+  /** 后台处理字段 */
+
+  // 来源页面
+  private String fromPage;
+
+  // 电话
+  private String phone;
+  // 表单公司
+  private String formCompany;
+  // 用户有效性
+  private String userEffectiveStr;
+  // 敏感词
+  private String sensitiveMessage;
+  // 系统有效性
+  private Integer sysEffective;
+  private String siteName;
+  private String transContent;
+  private String cartItems;
+
+  /** 用于前端默认展示第一行数据 */
+  private Integer dataIndex;
+
+  private String whatsApp;
+
+  private String wasteEnquiry;
+
+  private String countryName;
+
+  private String countryCode;
+
+  private Integer readStatus;
+
+  private String fromIp;
+
+  private String customerIp;
+
+  private String visitId;
+
+  private String principalUid;
+
+  private String principalName;
+
+  /** 特殊字段名 */
+  private String specialField;
+
+  private List<EnquirySpecialFields> specialFieldList;
+
+  /** 疑似垃圾询盘理由 */
+  private String effectiveReason;
+
+  /** 询盘来源插件名称 */
+  private String pluginName;
+
+  private String wasteEnquiryType;
 }

+ 335 - 403
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/entity/AdwebEnquiry.java

@@ -6,20 +6,16 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
+import java.io.Serializable;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.io.Serializable;
-import java.util.Date;
-
 /**
- * @Description: 询盘信息存储表单
- * @Author: jeecg-boot
- * @Date: 2024-10-12
- * @Version: V1.0
+ * @Description: 询盘信息存储表单 @Author: jeecg-boot @Date: 2024-10-12 @Version: V1.0
  */
 @Data
 @TableName("adweb_enquiry")
@@ -27,400 +23,336 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Schema(description = "询盘信息存储表单")
 public class AdwebEnquiry implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    @Schema(description = "主键ID")
-    private Long id;
-    /**
-     * 询盘单号、根据系统规定生成
-     */
-    @Excel(name = "询盘单号、根据系统规定生成", width = 15)
-    @Schema(description = "询盘单号、根据系统规定生成")
-    private String no;
-    /**
-     * 询盘来源IP
-     */
-    @Excel(name = "询盘来源IP", width = 15)
-    @Schema(description = "询盘来源IP")
-    private String fromIp;
-    /**
-     * 询盘发送者邮箱账号
-     */
-    @Excel(name = "询盘发送者邮箱账号", width = 15)
-    @Schema(description = "询盘发送者邮箱账号")
-    private String fromEmail;
-    /**
-     * 询盘模块:web:网站询盘 ;email:邮件询盘  ;diy_element:自定义组件询盘
-     */
-    @Excel(name = "询盘模块:web:网站询盘 ;email:邮件询盘  ;diy_element:自定义组件询盘", width = 15)
-    @Schema(description = "询盘模块:web:网站询盘 ;email:邮件询盘  ;diy_element:自定义组件询盘")
-    private String modular;
-    /**
-     * 发送人姓名
-     */
-    @Excel(name = "发送人姓名", width = 15)
-    @Schema(description = "发送人姓名")
-    private String fromUser;
-    /**
-     * 0删除,1有效,默认值1   2:待解析  3:数据解析中 4.解析失败
-     */
-    @Excel(name = "0删除,1有效,默认值1   2:待解析  3:数据解析中 4.解析失败", width = 15)
-    @Schema(description = "0删除,1有效,默认值1   2:待解析  3:数据解析中 4.解析失败")
-    private Integer status;
-    /**
-     * 数据解析次数
-     */
-    @Excel(name = "数据解析次数", width = 15)
-    @Schema(description = "数据解析次数")
-    private Integer dealCount;
-    /**
-     * 系统有效性  0:无效       1;有效 后台字段
-     */
-    @Excel(name = "系统有效性  0:无效       1;有效 后台字段", width = 15)
-    @Schema(description = "系统有效性  0:无效       1;有效 后台字段")
-    private Integer sysEffective;
-    /**
-     * 用户有效性  0:无效       1:有效   2 : 待定 取自字典表
-     */
-    @Excel(name = "用户有效性  0:无效       1:有效   2 : 待定 取自字典表", width = 15)
-    @Schema(description = "用户有效性  0:无效       1:有效   2 : 待定 取自字典表")
-    private Integer userEffective;
-    /**
-     * 敏感信息
-     */
-    @Excel(name = "敏感信息", width = 15)
-    @Schema(description = "敏感信息")
-    private String sensitiveMessage;
-    /**
-     * 询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃)
-     */
-    @Excel(name = "询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃)", width = 15)
-    @Schema(description = "询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃)")
-    private String phase;
-    /**
-     * 跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止)
-     */
-    @Excel(name = "跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止)", width = 15)
-    @Schema(description = "跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止)")
-    private String trackStatus;
-    /**
-     * 询盘所属用户主账号ID
-     */
-    @Excel(name = "询盘所属用户主账号ID", width = 15)
-    @Schema(description = "询盘所属用户主账号ID")
-    private String uid;
-    /**
-     * 询盘跟进人 id
-     */
-    @Excel(name = "询盘跟进人 id", width = 15)
-    @Schema(description = "询盘跟进人 id")
-    private Integer tracker;
-    /**
-     * 询盘创建时间
-     */
-    @Excel(name = "询盘创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "询盘创建时间")
-    private Date recordCtime;
-    /**
-     * ADMP平台创建时间
-     */
-    @Excel(name = "ADMP平台创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "ADMP平台创建时间")
-    private Date ctime;
-    /**
-     * 国家/地区(根据ip获取)
-     */
-    @Excel(name = "国家/地区(根据ip获取)", width = 15)
-    @Schema(description = "国家/地区(根据ip获取)")
-    private String country;
-    
-    /**
-     * 询盘插件名称,名称小写,如:wpforms
-     */
-    @Excel(name = "询盘插件名称,名称小写,如:wpforms", width = 15)
-    @Schema(description = "询盘插件名称,名称小写,如:wpforms")
-    private String pluginName;
-    /**
-     * 站点code,关联站点表
-     */
-    @Excel(name = "站点code,关联站点表", width = 15)
-    @Schema(description = "站点code,关联站点表")
-    private String siteCode;
-    /**
-     * 站点token
-     */
-    @Excel(name = "站点token", width = 15)
-    @Schema(description = "站点token")
-    private String siteToken;
-    /**
-     * 询盘来自站点的域名
-     */
-    @Excel(name = "询盘来自站点的域名", width = 15)
-    @Schema(description = "询盘来自站点的域名")
-    private String siteHost;
-    /**
-     * 询盘原站点记录ID
-     */
-    @Excel(name = "询盘原站点记录ID", width = 15)
-    @Schema(description = "询盘原站点记录ID")
-    private String recordId;
-    /**
-     * 状态更新时间
-     */
-    @Excel(name = "状态更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "状态更新时间")
-    private Date utime;
-    /**
-     * 回复时间
-     */
-    @Excel(name = "回复时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "回复时间")
-    private Date replyTime;
-    /**
-     * 转发状态:0未转发,1已转发,默认值0
-     */
-    @Excel(name = "转发状态:0未转发,1已转发,默认值0", width = 15)
-    @Schema(description = "转发状态:0未转发,1已转发,默认值0")
-    private Integer forward;
-    /**
-     * 转发时间
-     */
-    @Excel(name = "转发时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "转发时间")
-    private Date forwardTime;
-    /**
-     * 访客id
-     */
-    @Excel(name = "访客id", width = 15)
-    @Schema(description = "访客id")
-    private String visitId;
-    /**
-     * 来源于站点的id
-     */
-    @Excel(name = "来源于站点的id", width = 15)
-    @Schema(description = "来源于站点的id")
-    private Integer siteId;
-    /**
-     * 公司id
-     */
-    @Excel(name = "公司id", width = 15)
-    @Schema(description = "公司id")
-    private Integer companyId;
-    /**
-     * 联系人id,字符串组合
-     */
-    @Excel(name = "联系人id,字符串组合", width = 15)
-    @Schema(description = "联系人id,字符串组合")
-    private String contactIds;
-    /**
-     * 定时器任务修改查询唯一标识(10位随机数)
-     */
-    @Excel(name = "定时器任务修改查询唯一标识(10位随机数)", width = 15)
-    @Schema(description = "定时器任务修改查询唯一标识(10位随机数)")
-    private String jobId;
-    /**
-     * 回复状态
-     */
-    @Excel(name = "回复状态", width = 15)
-    @Schema(description = "回复状态")
-    private String replayStatus;
-    /**
-     * 外部编号
-     */
-    @Excel(name = "外部编号", width = 15)
-    @Schema(description = "外部编号")
-    private String noOut;
-    /**
-     * 处理后的询盘当地时间字段
-     */
-    @Excel(name = "处理后的询盘当地时间字段", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "处理后的询盘当地时间字段")
-    private Date modifyRecordCtime;
-    /**
-     * transContent
-     */
-    @Excel(name = "transContent", width = 15)
-    @Schema(description = "transContent")
-    private String transContent;
-    /**
-     * 国家code
-     */
-    @Excel(name = "国家code", width = 15)
-    @Schema(description = "国家code")
-    private String countryCode;
-    /**
-     * 国家名
-     */
-    @Excel(name = "国家名", width = 15)
-    @Schema(description = "国家名")
-    private String countryName;
-    /**
-     * whatsApp
-     */
-    @Excel(name = "whatsApp", width = 15)
-    @Schema(description = "whatsApp")
-    private String whatsApp;
-    /**
-     * 0:不是;1:是
-     */
-    @Excel(name = "0:不是;1:是", width = 15)
-    @Schema(description = "0:不是;1:是")
-    private Integer wasteEnquiry;
-    /**
-     * 推送状态,0:待发送,1:成功,2不予发送
-     */
-    @Excel(name = "推送状态,0:待发送,1:成功,2不予发送", width = 15)
-    @Schema(description = "推送状态,0:待发送,1:成功,2不予发送")
-    private Integer pushStatus;
-    /**
-     * 推送错误次数
-     */
-    @Excel(name = "推送错误次数", width = 15)
-    @Schema(description = "推送错误次数")
-    private Integer pushErrorNum;
-    /**
-     * 姓名
-     */
-    @Excel(name = "姓名", width = 15)
-    @Schema(description = "姓名")
-    private String name;
-    /**
-     * 邮箱地址
-     */
-    @Excel(name = "邮箱地址", width = 15)
-    @Schema(description = "邮箱地址")
-    private String email;
-    /**
-     * 询盘信息
-     */
-    @Excel(name = "询盘信息", width = 15)
-    @Schema(description = "询盘信息")
-    private String message;
-    /**
-     * 公司名称
-     */
-    @Excel(name = "公司名称", width = 15)
-    @Schema(description = "公司名称")
-    private String company;
-    /**
-     * 来源页面
-     */
-    @Excel(name = "来源页面", width = 15)
-    @Schema(description = "来源页面")
-    private String fromPage;
-    /**
-     * form表单传入Ip
-     */
-    @Excel(name = "form表单传入Ip", width = 15)
-    @Schema(description = "form表单传入Ip")
-    private String customerIp;
-    /**
-     * 手机号
-     */
-    @Excel(name = "手机号", width = 15)
-    @Schema(description = "手机号")
-    private String phone;
-    /**
-     * whatsapp
-     */
-
-    private String whatsapp;
-    /**
-     * 阅读状态,0是未阅读,1是已阅读
-     */
-    @Excel(name = "阅读状态,0是未阅读,1是已阅读", width = 15)
-    @Schema(description = "阅读状态,0是未阅读,1是已阅读")
-    private Integer readStatus;
-    /**
-     * 负责人的id
-     */
-    @Excel(name = "负责人的id", width = 15)
-    @Schema(description = "负责人的id")
-    private String principalUid;
-    /**
-     * 0代表系统根据规则分配,1代表主账户指定
-     */
-    @Excel(name = "0代表系统根据规则分配,1代表主账户指定", width = 15)
-    @Schema(description = "0代表系统根据规则分配,1代表主账户指定")
-    private Integer principalType;
-    /**
-     * form表单中的地址
-     */
-    @Excel(name = "form表单中的地址", width = 15)
-    @Schema(description = "form表单中的地址")
-    private String address;
-    /**
-     * 客户自定义字段
-     */
-    @Excel(name = "客户自定义字段", width = 15)
-    @Schema(description = "客户自定义字段")
-    private String specialField;
-    /**
-     * 向Wp发送请求时间
-     */
-    @Excel(name = "向Wp发送请求时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "向Wp发送请求时间")
-    private Date requestTime;
-    /**
-     * Adweb实时获取WebHookS消息时间,定时器无该值
-     */
-    @Excel(name = "Adweb实时获取WebHookS消息时间,定时器无该值", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "Adweb实时获取WebHookS消息时间,定时器无该值")
-    private Date acquireMessageTime;
-    /**
-     * 疑似垃圾询盘理由
-     */
-    @Excel(name = "疑似垃圾询盘理由", width = 15)
-    @Schema(description = "疑似垃圾询盘理由")
-    private String effectiveReason;
-    /**
-     * 垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other
-     */
-    @Excel(name = "垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other", width = 15)
-    @Schema(description = "垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other")
-    private String wasteEnquiryType;
-    /**
-     * 询盘关联产品
-     */
-    @Excel(name = "询盘关联产品", width = 15)
-    @Schema(description = "询盘关联产品")
-    private String cartItems;
-
-    /**
-     * 用于判断是否是·产品询盘·
-     */
-    @TableField(exist = false)
-    private Integer existProductEnquiry;
-
-    /**
-     * 用于判断是否是同步询盘进行发送询盘邮件
-     */
-    @TableField(exist = false)
-    private String isEnquirySync;
-
-    /**
-     * 用于判断是否是·联系我们询盘·
-     */
-    @TableField(exist = false)
-    private Integer existContactEnquiry;
+  private static final long serialVersionUID = 1L;
+
+  /** 主键ID */
+  @TableId(type = IdType.AUTO)
+  @Schema(description = "主键ID")
+  private Long id;
+
+  /** 询盘单号、根据系统规定生成 */
+  @Excel(name = "询盘单号、根据系统规定生成", width = 15)
+  @Schema(description = "询盘单号、根据系统规定生成")
+  private String no;
+
+  /** 询盘来源IP */
+  @Excel(name = "询盘来源IP", width = 15)
+  @Schema(description = "询盘来源IP")
+  private String fromIp;
+
+  /** 询盘发送者邮箱账号 */
+  @Excel(name = "询盘发送者邮箱账号", width = 15)
+  @Schema(description = "询盘发送者邮箱账号")
+  private String fromEmail;
+
+  /** 询盘模块:web:网站询盘 ;email:邮件询盘 ;diy_element:自定义组件询盘 */
+  @Excel(name = "询盘模块:web:网站询盘 ;email:邮件询盘  ;diy_element:自定义组件询盘", width = 15)
+  @Schema(description = "询盘模块:web:网站询盘 ;email:邮件询盘  ;diy_element:自定义组件询盘")
+  private String modular;
+
+  /** 发送人姓名 */
+  @Excel(name = "发送人姓名", width = 15)
+  @Schema(description = "发送人姓名")
+  private String fromUser;
+
+  /** 0删除,1有效,默认值1 2:待解析 3:数据解析中 4.解析失败 */
+  @Excel(name = "0删除,1有效,默认值1   2:待解析  3:数据解析中 4.解析失败", width = 15)
+  @Schema(description = "0删除,1有效,默认值1   2:待解析  3:数据解析中 4.解析失败")
+  private Integer status;
+
+  /** 数据解析次数 */
+  @Excel(name = "数据解析次数", width = 15)
+  @Schema(description = "数据解析次数")
+  private Integer dealCount;
+
+  /** 系统有效性 0:无效 1;有效 后台字段 */
+  @Excel(name = "系统有效性  0:无效       1;有效 后台字段", width = 15)
+  @Schema(description = "系统有效性  0:无效       1;有效 后台字段")
+  private Integer sysEffective;
+
+  /** 用户有效性 0:无效 1:有效 2 : 待定 取自字典表 */
+  @Excel(name = "用户有效性  0:无效       1:有效   2 : 待定 取自字典表", width = 15)
+  @Schema(description = "用户有效性  0:无效       1:有效   2 : 待定 取自字典表")
+  private Integer userEffective;
+
+  /** 敏感信息 */
+  @Excel(name = "敏感信息", width = 15)
+  @Schema(description = "敏感信息")
+  private String sensitiveMessage;
+
+  /** 询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃) */
+  @Excel(name = "询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃)", width = 15)
+  @Schema(description = "询盘阶段,由跟踪来决定(1:待沟通 ;2:沟通中;3:成单;4;放弃)")
+  private String phase;
+
+  /** 跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止) */
+  @Excel(name = "跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止)", width = 15)
+  @Schema(description = "跟进跟进状态,由跟踪来决定(1:待跟进 ;2:跟进中;3:完成;4;停止)")
+  private String trackStatus;
+
+  /** 询盘所属用户主账号ID */
+  @Excel(name = "询盘所属用户主账号ID", width = 15)
+  @Schema(description = "询盘所属用户主账号ID")
+  private String uid;
+
+  /** 询盘跟进人 id */
+  @Excel(name = "询盘跟进人 id", width = 15)
+  @Schema(description = "询盘跟进人 id")
+  private Integer tracker;
+
+  /** 询盘创建时间 */
+  @Excel(name = "询盘创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "询盘创建时间")
+  private Date recordCtime;
+
+  /** ADMP平台创建时间 */
+  @Excel(name = "ADMP平台创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "ADMP平台创建时间")
+  private Date ctime;
+
+  /** 国家/地区(根据ip获取) */
+  @Excel(name = "国家/地区(根据ip获取)", width = 15)
+  @Schema(description = "国家/地区(根据ip获取)")
+  private String country;
+
+  /** 询盘插件名称,名称小写,如:wpforms */
+  @Excel(name = "询盘插件名称,名称小写,如:wpforms", width = 15)
+  @Schema(description = "询盘插件名称,名称小写,如:wpforms")
+  private String pluginName;
+
+  /** 站点code,关联站点表 */
+  @Excel(name = "站点code,关联站点表", width = 15)
+  @Schema(description = "站点code,关联站点表")
+  private String siteCode;
+
+  /** 站点token */
+  @Excel(name = "站点token", width = 15)
+  @Schema(description = "站点token")
+  private String siteToken;
+
+  /** 询盘来自站点的域名 */
+  @Excel(name = "询盘来自站点的域名", width = 15)
+  @Schema(description = "询盘来自站点的域名")
+  private String siteHost;
+
+  /** 询盘原站点记录ID */
+  @Excel(name = "询盘原站点记录ID", width = 15)
+  @Schema(description = "询盘原站点记录ID")
+  private String recordId;
+
+  /** 状态更新时间 */
+  @Excel(name = "状态更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "状态更新时间")
+  private Date utime;
+
+  /** 回复时间 */
+  @Excel(name = "回复时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "回复时间")
+  private Date replyTime;
+
+  /** 转发状态:0未转发,1已转发,默认值0 */
+  @Excel(name = "转发状态:0未转发,1已转发,默认值0", width = 15)
+  @Schema(description = "转发状态:0未转发,1已转发,默认值0")
+  private Integer forward;
+
+  /** 转发时间 */
+  @Excel(name = "转发时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "转发时间")
+  private Date forwardTime;
+
+  /** 访客id */
+  @Excel(name = "访客id", width = 15)
+  @Schema(description = "访客id")
+  private String visitId;
+
+  /** 来源于站点的id */
+  @Excel(name = "来源于站点的id", width = 15)
+  @Schema(description = "来源于站点的id")
+  private Integer siteId;
+
+  /** 公司id */
+  @Excel(name = "公司id", width = 15)
+  @Schema(description = "公司id")
+  private Integer companyId;
+
+  /** 联系人id,字符串组合 */
+  @Excel(name = "联系人id,字符串组合", width = 15)
+  @Schema(description = "联系人id,字符串组合")
+  private String contactIds;
+
+  /** 定时器任务修改查询唯一标识(10位随机数) */
+  @Excel(name = "定时器任务修改查询唯一标识(10位随机数)", width = 15)
+  @Schema(description = "定时器任务修改查询唯一标识(10位随机数)")
+  private String jobId;
+
+  /** 回复状态 */
+  @Excel(name = "回复状态", width = 15)
+  @Schema(description = "回复状态")
+  private String replayStatus;
+
+  /** 外部编号 */
+  @Excel(name = "外部编号", width = 15)
+  @Schema(description = "外部编号")
+  private String noOut;
+
+  /** 处理后的询盘当地时间字段 */
+  @Excel(name = "处理后的询盘当地时间字段", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "处理后的询盘当地时间字段")
+  private Date modifyRecordCtime;
+
+  /** transContent */
+  @Excel(name = "transContent", width = 15)
+  @Schema(description = "transContent")
+  private String transContent;
+
+  /** 国家code */
+  @Excel(name = "国家code", width = 15)
+  @Schema(description = "国家code")
+  private String countryCode;
+
+  /** 国家名 */
+  @Excel(name = "国家名", width = 15)
+  @Schema(description = "国家名")
+  private String countryName;
+
+  /** whatsApp */
+  @Excel(name = "whatsApp", width = 15)
+  @Schema(description = "whatsApp")
+  private String whatsApp;
+
+  /** 0:不是;1:是 */
+  @Excel(name = "0:不是;1:是", width = 15)
+  @Schema(description = "0:不是;1:是")
+  private Integer wasteEnquiry;
+
+  /** 推送状态,0:待发送,1:成功,2不予发送 */
+  @Excel(name = "推送状态,0:待发送,1:成功,2不予发送", width = 15)
+  @Schema(description = "推送状态,0:待发送,1:成功,2不予发送")
+  private Integer pushStatus;
+
+  /** 推送错误次数 */
+  @Excel(name = "推送错误次数", width = 15)
+  @Schema(description = "推送错误次数")
+  private Integer pushErrorNum;
+
+  /** 姓名 */
+  @Excel(name = "姓名", width = 15)
+  @Schema(description = "姓名")
+  private String name;
+
+  /** 邮箱地址 */
+  @Excel(name = "邮箱地址", width = 15)
+  @Schema(description = "邮箱地址")
+  private String email;
+
+  /** 询盘信息 */
+  @Excel(name = "询盘信息", width = 15)
+  @Schema(description = "询盘信息")
+  private String message;
+
+  /** 公司名称 */
+  @Excel(name = "公司名称", width = 15)
+  @Schema(description = "公司名称")
+  private String company;
+
+  /** 来源页面 */
+  @Excel(name = "来源媒体", width = 15)
+  @Schema(description = "来源媒体")
+  private String fromSource;
+
+  /** 来源页面 */
+  @Excel(name = "来源页面", width = 15)
+  @Schema(description = "来源页面")
+  private String fromPage;
+
+  /** form表单传入Ip */
+  @Excel(name = "form表单传入Ip", width = 15)
+  @Schema(description = "form表单传入Ip")
+  private String customerIp;
+
+  /** 手机号 */
+  @Excel(name = "手机号", width = 15)
+  @Schema(description = "手机号")
+  private String phone;
+
+  /** whatsapp */
+  private String whatsapp;
+
+  /** 阅读状态,0是未阅读,1是已阅读 */
+  @Excel(name = "阅读状态,0是未阅读,1是已阅读", width = 15)
+  @Schema(description = "阅读状态,0是未阅读,1是已阅读")
+  private Integer readStatus;
+
+  /** 负责人的id */
+  @Excel(name = "负责人的id", width = 15)
+  @Schema(description = "负责人的id")
+  private String principalUid;
+
+  /** 0代表系统根据规则分配,1代表主账户指定 */
+  @Excel(name = "0代表系统根据规则分配,1代表主账户指定", width = 15)
+  @Schema(description = "0代表系统根据规则分配,1代表主账户指定")
+  private Integer principalType;
+
+  /** form表单中的地址 */
+  @Excel(name = "form表单中的地址", width = 15)
+  @Schema(description = "form表单中的地址")
+  private String address;
+
+  /** 客户自定义字段 */
+  @Excel(name = "客户自定义字段", width = 15)
+  @Schema(description = "客户自定义字段")
+  private String specialField;
+
+  /** 向Wp发送请求时间 */
+  @Excel(name = "向Wp发送请求时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "向Wp发送请求时间")
+  private Date requestTime;
+
+  /** Adweb实时获取WebHookS消息时间,定时器无该值 */
+  @Excel(name = "Adweb实时获取WebHookS消息时间,定时器无该值", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+  @Schema(description = "Adweb实时获取WebHookS消息时间,定时器无该值")
+  private Date acquireMessageTime;
+
+  /** 疑似垃圾询盘理由 */
+  @Excel(name = "疑似垃圾询盘理由", width = 15)
+  @Schema(description = "疑似垃圾询盘理由")
+  private String effectiveReason;
+
+  /** 垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other */
+  @Excel(name = "垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other", width = 15)
+  @Schema(description = "垃圾询盘类型,关键词:keyword,邮箱:email,ip: ip,其他:other")
+  private String wasteEnquiryType;
+
+  /** 询盘关联产品 */
+  @Excel(name = "询盘关联产品", width = 15)
+  @Schema(description = "询盘关联产品")
+  private String cartItems;
+
+  /** 用于判断是否是·产品询盘· */
+  @TableField(exist = false)
+  private Integer existProductEnquiry;
+
+  /** 用于判断是否是同步询盘进行发送询盘邮件 */
+  @TableField(exist = false)
+  private String isEnquirySync;
+
+  /** 用于判断是否是·联系我们询盘· */
+  @TableField(exist = false)
+  private Integer existContactEnquiry;
 }

+ 8 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/AdwebEnquiryMapper.java

@@ -101,4 +101,12 @@ public interface AdwebEnquiryMapper extends BaseMapper<AdwebEnquiry> {
 
   /** 统计管理的询盘数量 */
   List<JSONObject> getEnquiryCount(List<String> uids);
+
+  /**
+   * 根据站点code查询此站点下询盘最新一条的id
+   *
+   * @param siteCode
+   * @return
+   */
+  String getMaxRecordIdByCode(String siteCode, String plugin);
 }

+ 7 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/xml/AdwebEnquiryMapper.xml

@@ -426,4 +426,11 @@
         principal_uid
     </select>
 
+    <select id="getMaxRecordIdByCode" parameterType="java.lang.String" resultType="java.lang.String">
+        SELECT MAX(record_id + 0)
+        FROM adweb_enquiry
+        WHERE site_code = #{siteCode}
+          AND plugin_name = #{plugin}
+    </select>
+
 </mapper>

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

@@ -16,11 +16,9 @@ public interface IAdwebEnquiryService extends IService<AdwebEnquiry> {
   /** 统计管理的询盘数量 */
   Map<String, Integer> getEnquiryCount(List<String> uids);
 
-  /**
-   * 统计管理的询盘数量
-   */
+  /** 统计管理的询盘数量 */
   int getEnquiryCount(String uid);
-  
+
   void addEnquiry(EnquiryDTO enquiryDTO, String plugin, AdwebSite adwebSite);
 
   /** 返回用户名称 */

+ 38 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java

@@ -298,7 +298,11 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
 
       String forms = FastJsonUtil.toJSONString(enquiryDto.getForms());
       parseFormAndSetFields(adwebEnquiry, forms, adwebSite);
-      setCountryByIp(adwebEnquiry);
+
+      if (StringUtils.isNotBlank(adwebEnquiry.getFromIp())) {
+        setCountryByIp(adwebEnquiry);
+      }
+
       setPrincipal(adwebEnquiry, adwebSite.getEnquiryDistributeType(), adwebSite.getId());
       adwebEnquiryList.add(adwebEnquiry);
 
@@ -457,14 +461,26 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
     } else {
       String emailStr = adwebSite.getEnquiryEmailList();
       if (StringUtil.isEmpty(emailStr)) {
-        log.info("未获取到站点邮箱");
-        return;
+        log.info("该站点未获取到站点配置邮箱:{}", adwebSite.getName());
       }
       log.info("发送询盘邮件--站点邮箱:{}", emailStr);
       log.info("发送询盘邮件--子账户邮箱:{}", FastJsonUtil.toJSONString(principalEmailMap));
 
-      List<String> emailList = JSON.parseArray(emailStr, String.class);
+      List<String> emailList = new ArrayList<>();
+      if (StringUtils.isNotBlank(emailStr)) {
+        emailList = JSON.parseArray(emailStr, String.class);
+      }
+
+      SysUser sysUser = sysUserService.getById(adwebEnquiry.getUid());
+
+      if (sysUser != null && !emailList.contains(sysUser.getEmail())) {
+        emailList.add(sysUser.getEmail());
+      }
+
+      log.info("发送询盘邮件--站点包含用户邮箱:{}", FastJsonUtil.toJSONString(emailList));
+
       if (CollectionUtils.isEmpty(emailList)) {
+        log.error("该站点未配置主账号邮箱和站点邮箱");
         return;
       }
 
@@ -851,8 +867,11 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
     adwebEnquiry.setFromEmail(enquiryDto.getFromEmail());
     adwebEnquiry.setPluginName(enquiryDto.getPluginName());
     adwebEnquiry.setRecordId(enquiryDto.getRecordId());
-    adwebEnquiry.setModifyRecordCtime(
-        geoIpUtil.getLocalhostTime(enquiryDto.getFromIp(), enquiryDto.getRecordCtime()));
+    Date modifyRecordCtime =
+        StringUtils.isNotBlank(enquiryDto.getFromIp())
+            ? geoIpUtil.getLocalhostTime(enquiryDto.getFromIp(), enquiryDto.getRecordCtime())
+            : new Date();
+    adwebEnquiry.setModifyRecordCtime(modifyRecordCtime);
     adwebEnquiry.setRecordCtime(enquiryDto.getRecordCtime());
     adwebEnquiry.setSiteCode(adwebSite.getCode());
     adwebEnquiry.setModular(enquiryDto.getPluginName());
@@ -872,6 +891,19 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
     adwebEnquiry.setAcquireMessageTime(adwebSite.getEnquiryMessageTime());
     adwebEnquiry.setIsEnquirySync("enquirySync");
 
+    adwebEnquiry.setFromSource(enquiryDto.getFromSource());
+    adwebEnquiry.setCountryCode(enquiryDto.getCountryCode());
+
+    QueryWrapper<AdwebCountry> queryWrapper = new QueryWrapper<>();
+    queryWrapper.eq("country_iso_code", enquiryDto.getCountryCode());
+
+    AdwebCountry adwebCountry = adwebCountryService.getOne(queryWrapper);
+
+    if (adwebCountry != null) {
+      adwebEnquiry.setCountry(adwebCountry.getCountryName());
+      adwebEnquiry.setCountryName(adwebCountry.getCountryName());
+    }
+
     ObjectMapper objectMapper = new ObjectMapper();
     try {
       String jsonString = objectMapper.writeValueAsString(enquiryDto.getCartItems());

+ 0 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/controller/AdwebUserCountryController.java

@@ -416,10 +416,6 @@ public class AdwebUserCountryController
   @PostMapping(value = "/updateSendEmailType")
   public Result<?> updateSendEmailType(
       @RequestParam Integer siteId, @RequestParam String sendEmailType) {
-    LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-    //        if(sysUser.isPerform()){
-    //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-    //        }
     LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
     updateWrapper.eq(AdwebSite::getId, siteId);
     updateWrapper.set(AdwebSite::getEnquirySendEmailType, sendEmailType);

+ 2 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/xml/AdwebUserCountryMapper.xml

@@ -41,7 +41,8 @@
     </select>
     <select id="getSubUserOptions" resultType="org.jeecg.modules.adweb.userCountry.dto.SubUser">
         SELECT t1.id,
-               t1.realname username
+               t1.username username,
+               t1.realname realname
         FROM adweb_master_sub_account_relation t0,
              sys_user t1
         WHERE t0.sub_id = t1.id

+ 178 - 173
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/EmailSendMsgHandle.java

@@ -1,6 +1,12 @@
 package org.jeecg.modules.message.handle.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import jakarta.mail.MessagingException;
+import jakarta.mail.internet.MimeMessage;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Set;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.jeecg.common.api.dto.message.MessageDTO;
@@ -18,199 +24,198 @@ import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.mail.javamail.MimeMessageHelper;
 import org.springframework.stereotype.Component;
 
-import jakarta.mail.MessagingException;
-import jakarta.mail.internet.MimeMessage;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.List;
-import java.util.Set;
-
 /**
  * @Description: 邮箱发送信息
+ *
  * @author: jeecg-boot
  */
 @Slf4j
 @Component("emailSendMsgHandle")
 public class EmailSendMsgHandle implements ISendMsgHandle {
-    static String emailFrom;
-
-    public static void setEmailFrom(String emailFrom) {
-        EmailSendMsgHandle.emailFrom = emailFrom;
-    }
+  static String emailFrom;
 
-    @Autowired
-    SysUserMapper sysUserMapper;
+  public static void setEmailFrom(String emailFrom) {
+    EmailSendMsgHandle.emailFrom = emailFrom;
+  }
 
-    @Autowired
-    private RedisUtil redisUtil;
+  @Autowired SysUserMapper sysUserMapper;
 
-    /**
-     * 真实姓名变量
-     */
-    private static final String  realNameExp = "{REALNAME}";
+  @Autowired private RedisUtil redisUtil;
 
+  /** 真实姓名变量 */
+  private static final String realNameExp = "{REALNAME}";
 
-
-    @Override
-    public void sendMsg(String esReceiver, String esTitle, String esContent) {
-        JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
-        MimeMessage message = mailSender.createMimeMessage();
-        MimeMessageHelper helper = null;
-        //update-begin-author:taoyan date:20200811 for:配置类数据获取
-        if(oConvertUtils.isEmpty(emailFrom)){
-            StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
-            setEmailFrom(staticConfig.getEmailFrom());
-        }
-        //update-end-author:taoyan date:20200811 for:配置类数据获取
-        try {
-            helper = new MimeMessageHelper(message, true);
-            // 设置发送方邮箱地址
-            helper.setFrom(emailFrom);
-            helper.setTo(esReceiver);
-            helper.setSubject(esTitle);
-            helper.setText(esContent, true);
-            mailSender.send(message);
-        } catch (MessagingException e) {
-            e.printStackTrace();
-        }
-
+  @Override
+  public void sendMsg(String esReceiver, String esTitle, String esContent) {
+    JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
+    MimeMessage message = mailSender.createMimeMessage();
+    MimeMessageHelper helper = null;
+    // update-begin-author:taoyan date:20200811 for:配置类数据获取
+    if (oConvertUtils.isEmpty(emailFrom)) {
+      StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
+      setEmailFrom(staticConfig.getEmailFrom());
     }
-
-    @Override
-    public void sendMessage(MessageDTO messageDTO) {
-        String[] arr = messageDTO.getToUser().split(",");
-        LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, arr);
-        List<SysUser> list = sysUserMapper.selectList(query);
-        String content = messageDTO.getContent();
-        String title = messageDTO.getTitle();
-        for(SysUser user: list){
-            String email = user.getEmail();
-            if (ObjectUtils.isEmpty(email)) {
-                continue;
-            }
-            content=replaceContent(user,content);
-            log.info("邮件内容:"+ content);
-            sendMsg(email, title, content);
-        }
-        
-        //update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
-        Set<String> toEmailList = messageDTO.getToEmailList();
-        if(toEmailList!=null && toEmailList.size()>0){
-            for(String email: toEmailList){
-                if (ObjectUtils.isEmpty(email)) {
-                    continue;
-                }
-                log.info("邮件内容:"+ content);
-                sendMsg(email, title, content);
-            }
-        }
-        //update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
-        
-        //发送给抄送人
-        sendMessageToCopyUser(messageDTO);
+    // update-end-author:taoyan date:20200811 for:配置类数据获取
+    try {
+      helper = new MimeMessageHelper(message, true);
+      // 设置发送方邮箱地址
+      helper.setFrom(emailFrom);
+      helper.setTo(esReceiver);
+      helper.setSubject(esTitle);
+      helper.setText(esContent, true);
+      mailSender.send(message);
+    } catch (MessagingException e) {
+      log.error("邮件Sender发送失败", e);
     }
-
-    /**
-     * 发送邮件给抄送人
-     * @param messageDTO
-     */
-    public void sendMessageToCopyUser(MessageDTO messageDTO) {
-        String copyToUser = messageDTO.getCopyToUser();
-        if(ObjectUtils.isNotEmpty(copyToUser)) {
-            LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, copyToUser.split(","));
-            List<SysUser> list = sysUserMapper.selectList(query);
-            String content = messageDTO.getContent();
-            String title = messageDTO.getTitle();
-
-            for (SysUser user : list) {
-                String email = user.getEmail();
-                if (ObjectUtils.isEmpty(email)) {
-                    continue;
-                }
-                content=replaceContent(user,content);
-                log.info("邮件内容:" + content);
-                
-            //update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
-                sendEmail(email, content, title);
-            }
-
-            Set<String> ccEmailList = messageDTO.getCcEmailList();
-            if(ccEmailList!=null && ccEmailList.size()>0){
-                for(String email: ccEmailList){
-                    if (ObjectUtils.isEmpty(email)) {
-                        continue;
-                    }
-                    log.info("邮件内容:"+ content);
-                    sendEmail(email, content, title);
-                }
-            }
-            
-        }
+  }
+
+  @Override
+  public void sendMessage(MessageDTO messageDTO) {
+    String[] arr = messageDTO.getToUser().split(",");
+    LambdaQueryWrapper<SysUser> query =
+        new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, arr);
+    List<SysUser> list = sysUserMapper.selectList(query);
+    String content = messageDTO.getContent();
+    String title = messageDTO.getTitle();
+    for (SysUser user : list) {
+      String email = user.getEmail();
+      if (ObjectUtils.isEmpty(email)) {
+        continue;
+      }
+      content = replaceContent(user, content);
+      log.info("邮件内容:" + content);
+      sendMsg(email, title, content);
     }
 
-    /**
-     * 发送邮件给抄送人调用
-     * @param email
-     * @param content
-     * @param title
-     */
-    private void sendEmail(String email, String content, String title){
-        JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
-        MimeMessage message = mailSender.createMimeMessage();
-        MimeMessageHelper helper = null;
-        if (oConvertUtils.isEmpty(emailFrom)) {
-            StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
-            setEmailFrom(staticConfig.getEmailFrom());
-        }
-        try {
-            helper = new MimeMessageHelper(message, true);
-            // 设置发送方邮箱地址
-            helper.setFrom(emailFrom);
-            helper.setTo(email);
-            //设置抄送人
-            helper.setCc(email);
-            helper.setSubject(title);
-            helper.setText(content, true);
-            mailSender.send(message);
-        } catch (MessagingException e) {
-            e.printStackTrace();
+    // update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱
+    // 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
+    Set<String> toEmailList = messageDTO.getToEmailList();
+    if (toEmailList != null && toEmailList.size() > 0) {
+      for (String email : toEmailList) {
+        if (ObjectUtils.isEmpty(email)) {
+          continue;
         }
+        log.info("邮件内容:" + content);
+        sendMsg(email, title, content);
+      }
     }
-    //update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
-    
-
-    /**
-     * 替换邮件内容变量
-     * @param user
-     * @param content
-     * @return
-     */
-    private String replaceContent(SysUser user,String content){
-        if (content.indexOf(realNameExp) > 0) {
-            content = content.replace("$"+realNameExp,user.getRealname()).replace(realNameExp, user.getRealname());
+    // update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱
+    // 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
+
+    // 发送给抄送人
+    sendMessageToCopyUser(messageDTO);
+  }
+
+  /**
+   * 发送邮件给抄送人
+   *
+   * @param messageDTO
+   */
+  public void sendMessageToCopyUser(MessageDTO messageDTO) {
+    String copyToUser = messageDTO.getCopyToUser();
+    if (ObjectUtils.isNotEmpty(copyToUser)) {
+      LambdaQueryWrapper<SysUser> query =
+          new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, copyToUser.split(","));
+      List<SysUser> list = sysUserMapper.selectList(query);
+      String content = messageDTO.getContent();
+      String title = messageDTO.getTitle();
+
+      for (SysUser user : list) {
+        String email = user.getEmail();
+        if (ObjectUtils.isEmpty(email)) {
+          continue;
         }
-        if (content.indexOf(CommonConstant.LOGIN_TOKEN) > 0) {
-            String token = getToken(user);
-            try {
-                content = content.replace(CommonConstant.LOGIN_TOKEN, URLEncoder.encode(token, "UTF-8"));
-            } catch (UnsupportedEncodingException e) {
-                log.error("邮件消息token编码失败", e.getMessage());
-            }
+        content = replaceContent(user, content);
+        log.info("邮件内容:" + content);
+
+        // update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱
+        // 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
+        sendEmail(email, content, title);
+      }
+
+      Set<String> ccEmailList = messageDTO.getCcEmailList();
+      if (ccEmailList != null && ccEmailList.size() > 0) {
+        for (String email : ccEmailList) {
+          if (ObjectUtils.isEmpty(email)) {
+            continue;
+          }
+          log.info("邮件内容:" + content);
+          sendEmail(email, content, title);
         }
-        return content;
+      }
     }
-
-    /**
-     * 获取token
-     * @param user
-     * @return
-     */
-    private String getToken(SysUser user) {
-        // 生成token
-        String token = JwtUtil.sign(user.getUsername(), user.getPassword());
-        redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
-        // 设置超时时间 1个小时
-        redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 1 / 1000);
-        return token;
+  }
+
+  /**
+   * 发送邮件给抄送人调用
+   *
+   * @param email
+   * @param content
+   * @param title
+   */
+  private void sendEmail(String email, String content, String title) {
+    JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
+    MimeMessage message = mailSender.createMimeMessage();
+    MimeMessageHelper helper = null;
+    if (oConvertUtils.isEmpty(emailFrom)) {
+      StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
+      setEmailFrom(staticConfig.getEmailFrom());
+    }
+    try {
+      helper = new MimeMessageHelper(message, true);
+      // 设置发送方邮箱地址
+      helper.setFrom(emailFrom);
+      helper.setTo(email);
+      // 设置抄送人
+      helper.setCc(email);
+      helper.setSubject(title);
+      helper.setText(content, true);
+      mailSender.send(message);
+    } catch (MessagingException e) {
+      e.printStackTrace();
+    }
+  }
+
+  // update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱
+  // 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
+
+  /**
+   * 替换邮件内容变量
+   *
+   * @param user
+   * @param content
+   * @return
+   */
+  private String replaceContent(SysUser user, String content) {
+    if (content.indexOf(realNameExp) > 0) {
+      content =
+          content
+              .replace("$" + realNameExp, user.getRealname())
+              .replace(realNameExp, user.getRealname());
+    }
+    if (content.indexOf(CommonConstant.LOGIN_TOKEN) > 0) {
+      String token = getToken(user);
+      try {
+        content = content.replace(CommonConstant.LOGIN_TOKEN, URLEncoder.encode(token, "UTF-8"));
+      } catch (UnsupportedEncodingException e) {
+        log.error("邮件消息token编码失败", e.getMessage());
+      }
     }
+    return content;
+  }
+
+  /**
+   * 获取token
+   *
+   * @param user
+   * @return
+   */
+  private String getToken(SysUser user) {
+    // 生成token
+    String token = JwtUtil.sign(user.getUsername(), user.getPassword());
+    redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+    // 设置超时时间 1个小时
+    redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 1 / 1000);
+    return token;
+  }
 }

+ 10 - 13
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/mapper/SysMessageTemplateMapper.java

@@ -1,24 +1,21 @@
 package org.jeecg.modules.message.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import java.util.List;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.message.entity.SysMessageTemplate;
 
-import java.util.List;
-
 /**
- * @Description: 消息模板
- * @Author: jeecg-boot
- * @Date:  2019-04-09
- * @Version: V1.0
+ * @Description: 消息模板 @Author: jeecg-boot @Date: 2019-04-09 @Version: V1.0
  */
 public interface SysMessageTemplateMapper extends BaseMapper<SysMessageTemplate> {
 
-    /**
-     * 通过模板CODE查询消息模板
-     * @param code 模板CODE
-     * @return List<SysMessageTemplate>
-     */
-    @Select("SELECT * FROM SYS_SMS_TEMPLATE WHERE TEMPLATE_CODE = #{code}")
-    List<SysMessageTemplate> selectByCode(String code);
+  /**
+   * 通过模板CODE查询消息模板
+   *
+   * @param code 模板CODE
+   * @return List<SysMessageTemplate>
+   */
+  @Select("SELECT * FROM sys_sms_template WHERE template_code = #{code}")
+  List<SysMessageTemplate> selectByCode(String code);
 }

+ 3 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mq/EnquiryReceiver.java

@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
 import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
 import org.jeecg.common.annotation.RabbitComponent;
+import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.modules.adweb.common.service.FeishuService;
 import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.dto.EnquiryDTO;
@@ -74,6 +75,8 @@ public class EnquiryReceiver extends BaseRabbiMqHandler<List<EnquiryDTO>> {
                 // 消息内容唯一性判断
                 List<String> enquiryUniqueIds =
                     (List<String>) adwebRedisUtil.get(EnquiryUniqueKey + enquiry.getSiteHost());
+
+                log.info("询盘唯一性存储条件:{}", FastJsonUtil.toJSONString(enquiryUniqueIds));
                 // 如果该消息内容原数据中已存在,则将该重复消息踢出队列
                 if (enquiryUniqueIds.contains(enquiry.getSiteHost() + enquiry.getRecordId())) {
                   log.info("该询盘已经消费过,从队列中清除:{}", enquiry.getRecordId());