Преглед изворни кода

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

chenpeiqing пре 5 месеци
родитељ
комит
e5299c7317
36 измењених фајлова са 2144 додато и 97 уклоњено
  1. 6 0
      jeecg-module-system/jeecg-system-biz/pom.xml
  2. 38 38
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/constant/AdwebConstant.java
  3. 55 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/AwsTranslateUtils.java
  4. 11 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryDistributeTypeConstant.java
  5. 305 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryBlacklistController.java
  6. 389 20
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryController.java
  7. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquirySearchDto.java
  8. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java
  9. 6 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/entity/AdwebEnquiry.java
  10. 39 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/AdwebEnquiryMapper.java
  11. 105 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mapper/xml/AdwebEnquiryMapper.xml
  12. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryService.java
  13. 120 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java
  14. 0 11
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackEmailServiceImpl.java
  15. 2 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/mapper/SiteUserPermissionMapper.java
  16. 9 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebSiteService.java
  17. 31 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java
  18. 0 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/SiteUserPermissionServiceImpl.java
  19. 6 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java
  20. 16 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/SysAdwebApiImpl.java
  21. 557 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/controller/AdwebUserCountryController.java
  22. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/DistributeCountryParam.java
  23. 21 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/SubUser.java
  24. 21 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/TreeOption.java
  25. 54 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/entity/AdwebCountry.java
  26. 57 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/entity/AdwebUserCountry.java
  27. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/AdwebCountryMapper.java
  28. 33 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/AdwebUserCountryMapper.java
  29. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/xml/AdwebCountryMapper.xml
  30. 55 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/xml/AdwebUserCountryMapper.xml
  31. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebCountryService.java
  32. 33 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebUserCountryService.java
  33. 18 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebCountryServiceImpl.java
  34. 68 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebUserCountryServiceImpl.java
  35. 12 0
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  36. 12 0
      jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml

+ 6 - 0
jeecg-module-system/jeecg-system-biz/pom.xml

@@ -106,6 +106,12 @@
 			<artifactId>dataforseo-client</artifactId>
 			<version>1.0.19</version>
 		</dependency>
+
+		<dependency>
+			<groupId>com.amazonaws</groupId>
+			<artifactId>aws-java-sdk</artifactId>
+			<version>1.11.1000</version>
+		</dependency>
     </dependencies>
 
 </project>

+ 38 - 38
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/constant/AdwebConstant.java

@@ -2,85 +2,85 @@ package org.jeecg.modules.adweb.common.constant;
 
 public interface AdwebConstant {
     /*网站类型(1模板,2站点)*/
-    public static final Integer TEMPLATE = 1;
-    public static final Integer SITE = 2;
-    public static final Integer WPTEMPLATE = 3;
+   Integer TEMPLATE = 1;
+   Integer SITE = 2;
+   Integer WPTEMPLATE = 3;
 
     /*网站状态 当前状态:0:已删除;1:正常; 2:未发布*/
-    public static final Integer SITE_DEL = 0;
+   Integer SITE_DEL = 0;
 
-    public static final Integer SITE_PUBLISH = 1;
+   Integer SITE_PUBLISH = 1;
 
-    public static final Integer SITE_UNPUBLISH = 2;
+   Integer SITE_UNPUBLISH = 2;
 
     /*菜单状态*/
-    public static final Integer MENU_DEL  = 1;
+   Integer MENU_DEL  = 1;
 
     /*模板配置状态*/
-    public static final Integer TEMPLATE_SETTING_DEL  = 1;
+   Integer TEMPLATE_SETTING_DEL  = 1;
 
     /*模板上架状态*/
-    public static final Integer TEMPLATE_PUTAWAY = 1;
+   Integer TEMPLATE_PUTAWAY = 1;
 
     /*产品状态0删除1可用*/
-    public static final Integer STATUS = 1;
+   Integer STATUS = 1;
 
     /*组件编码*/
-    public static final String PRODUCT = "product";
+   String PRODUCT = "product";
 
     /*内容*/
-    public static final String NEWS = "news";
+   String NEWS = "news";
 
     /*平台标识*/
-    public static final String APPKEY = "adweb";
+   String APPKEY = "adweb";
 
     /*内容分类*/
-    public static final String NEWSCATALOG = "newsCatalog";
+   String NEWSCATALOG = "newsCatalog";
 
-    public static final String PRODUCTCTALOG = "productCatalog";
+   String PRODUCTCTALOG = "productCatalog";
 
     /**
      * 缓存前缀
      */
-    public static final String CACHE_PREFIX = "AdWeb3::";
+   String CACHE_PREFIX = "AdWeb3::";
 
     //询盘阶段,字典条目
-    public static final String ENQUIRY_PHASE = "enquiry_phase";
+   String ENQUIRY_PHASE = "enquiry_phase";
     //询盘跟进状态,字典条目
-    public static final String ENQUIRY_TRACK_STATUS = "enquiry_track_status";
+   String ENQUIRY_TRACK_STATUS = "enquiry_track_status";
     //询盘用户有效性,字典条目
-    public static final String ENQUIRY_EFFECTIVE = "enquiry_effective";
+    String ENQUIRY_EFFECTIVE = "enquiry_effective";
     //询盘回复状态,字典条目
-    public static final String ENQUIRY_REPLAY_STATUS = "enquiry_replay_status";
+   String ENQUIRY_REPLAY_STATUS = "enquiry_replay_status";
     //ADMP dictService
-    public static final String CUSTOMER_ORDER_CURRENCY = "customer_order_currency";
+   String CUSTOMER_ORDER_CURRENCY = "customer_order_currency";
 
-    public static final String ENQUIRY_PARAM_NAME = "enquiry_param_name";
-    public static final String ENQUIRY_PARAM_EMAIL = "enquiry_param_email";
-    public static final String ENQUIRY_PARAM_PHONE = "enquiry_param_phone";
-    public static final String ENQUIRY_PARAM_MESSAGE = "enquiry_param_message";
-    public static final String ENQUIRY_PARAM_COMPANY = "enquiry_param_company";
-    public static final String ENQUIRY_PARAM_FROM_PAGE = "enquiry_param_from_page";
+   String ENQUIRY_PARAM_NAME = "enquiry_param_name";
+   String ENQUIRY_PARAM_EMAIL = "enquiry_param_email";
+   String ENQUIRY_PARAM_PHONE = "enquiry_param_phone";
+   String ENQUIRY_PARAM_MESSAGE = "enquiry_param_message";
+   String ENQUIRY_PARAM_COMPANY = "enquiry_param_company";
+   String ENQUIRY_PARAM_FROM_PAGE = "enquiry_param_from_page";
 
     /**
      * 页面code
      */
-    public static final String HOME_PAGE_CODE = "home";
-    public static final String ABOUT_US_PAGE_CODE = "aboutUs";
-    public static final String PRODUCTS_PAGE_CODE = "products";
-    public static final String PRODUCT_DETAIL_PAGE_CODE = "productDetail";
-    public static final String NEWS_PAGE_CODE = "news";
-    public static final String NEWS_DETAIL_PAGE_CODE = "newsDetail";
-    public static final String CONTACT_US_PAGE_CODE = "contactUs";
-    public static final String FAQ_PAGE_CODE = "faq";
+   String HOME_PAGE_CODE = "home";
+   String ABOUT_US_PAGE_CODE = "aboutUs";
+   String PRODUCTS_PAGE_CODE = "products";
+   String PRODUCT_DETAIL_PAGE_CODE = "productDetail";
+   String NEWS_PAGE_CODE = "news";
+   String NEWS_DETAIL_PAGE_CODE = "newsDetail";
+   String CONTACT_US_PAGE_CODE = "contactUs";
+   String FAQ_PAGE_CODE = "faq";
 
     /**
      * 模板标签
      */
-    public static final String TEMPLATE_TAGS = "template_tags";
+   String TEMPLATE_TAGS = "template_tags";
 
     /*SEO关键字类型 1 - 指定词 2 - 长尾词 */
-    public static final int KEYWORD_TYPE_APPOINT = 1;
-    public static final int KEYWORD_TYPE_LONG_TAIL = 2;
+   int KEYWORD_TYPE_APPOINT = 1;
+   int KEYWORD_TYPE_LONG_TAIL = 2;
 
 }

+ 55 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/AwsTranslateUtils.java

@@ -0,0 +1,55 @@
+package org.jeecg.modules.adweb.common.util;
+
+import com.amazonaws.auth.AWSStaticCredentialsProvider;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.services.translate.AmazonTranslate;
+import com.amazonaws.services.translate.AmazonTranslateClient;
+import com.amazonaws.services.translate.model.TranslateTextRequest;
+import com.amazonaws.services.translate.model.TranslateTextResult;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author: wrk
+ * @date 2022/8/3 11:03
+ */
+@Component
+@Slf4j
+public class AwsTranslateUtils {
+
+    private static final String REGION = "us-west-2";
+
+    @Value("${aws.translate.accessKey}")
+    private String accessKey;
+
+    @Value("${aws.translate.secretKey}")
+    private String secretKey;
+
+
+    /**
+     * 翻译中文
+     * @param text
+     * @return
+     */
+    public String translate(String text){
+        try {
+            BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey);
+            AmazonTranslate translate = AmazonTranslateClient.builder()
+                    .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
+                    .withRegion(REGION)
+                    .build();
+
+            TranslateTextRequest request = new TranslateTextRequest()
+                    .withText(text)
+                    .withSourceLanguageCode("auto")
+                    .withTargetLanguageCode("zh");
+            TranslateTextResult result  = translate.translateText(request);
+            return result.getTranslatedText();
+        } catch (Exception e){
+            log.error("调用亚马逊翻译接口失败", e);
+        }
+        return "";
+    }
+}

+ 11 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryDistributeTypeConstant.java

@@ -0,0 +1,11 @@
+package org.jeecg.modules.adweb.enquiry.constant;
+
+public class EnquiryDistributeTypeConstant {
+
+    public static final String MASTER = "MASTER";
+
+    public static final String ALL = "ALL";
+
+    public static final String REGION = "REGION";
+
+}

+ 305 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryBlacklistController.java

@@ -0,0 +1,305 @@
+package org.jeecg.modules.adweb.enquiry.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.vo.LoginUser;
+
+import org.jeecg.modules.adweb.enquiry.constant.EnquiryDistributeTypeConstant;
+import org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto;
+import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
+import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryBlacklist;
+import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteBlackEmail;
+import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryBlacklistService;
+import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
+import org.jeecg.modules.adweb.enquiry.service.IAdwebSiteBlackEmailService;
+
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
+import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
+import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
+import org.jeecg.modules.adweb.system.service.SysAdwebApi;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebUserCountryService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description: adweb_enquiry_blacklist
+ * @Author: jeecg-boot
+ * @Date: 2022-08-05
+ * @Version: V1.0
+ */
+@Tag(name = "adweb_enquiry_blacklist")
+@RestController
+@RequestMapping("/enquiry/blacklist")
+@Slf4j
+public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquiryBlacklist, IAdwebEnquiryBlacklistService> {
+    @Resource
+    private IAdwebEnquiryBlacklistService adwebEnquiryBlacklistService;
+
+    @Resource
+    private IAdwebEnquiryService adwebEnquiryService;
+
+    @Resource
+    private ISysBaseAPI sysBaseAPI;
+
+	@Resource
+	private SysAdwebApi sysAdwebApi;
+
+    @Resource
+    private IAdwebSiteService adwebSiteService;
+
+    @Resource
+    private ISiteUserPermissionService siteUserPermissionService;
+
+    @Resource
+    private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
+
+    @Resource
+    private IAdwebUserCountryService adwebUserCountryService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param queryParam 查询参数,邮箱/姓名/国家
+     */
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(String queryParam,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                   Integer siteId) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<AdwebEnquiryBlacklist> queryWrapper = new QueryWrapper<>();
+        if (siteId != null) {
+            List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(siteId);
+            queryWrapper.in("site_id", siteIds);
+        } else if (!sysBaseAPI.isAdmin()) {
+            if (sysBaseAPI.isOem()) {
+                List<String> oemGroupUids = sysBaseAPI.getOemGroupUids();
+
+                List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(oemGroupUids);
+                QueryWrapper<AdwebSite> queryWrapper1 = new QueryWrapper<>();
+                queryWrapper1.ne("status", 0);
+                queryWrapper1.in("code", codeList);
+                List<AdwebSite> siteList = adwebSiteService.list(queryWrapper1);
+                List<Integer> siteIds = new ArrayList<>();
+                for (AdwebSite site : siteList) {
+                    siteIds.add(site.getId());
+                }
+                queryWrapper.in("site_id", siteIds);
+            } else {
+                List<Integer> siteIds = adwebSiteService.getAllSiteIdByUid(loginUser.getId());
+                queryWrapper.in("site_id", siteIds);
+            }
+        }
+        if (StringUtils.isNotBlank(queryParam)) {
+            queryWrapper.and(wrapper -> wrapper.like("email", queryParam)
+                    .or().like("name", queryParam)
+                    .or().like("country_name", queryParam));
+        }
+
+        if (sysAdwebApi.isAdwebSubVip()) {
+            AdwebSite site = adwebSiteService.getById(siteId);
+            String distributeType = site.getEnquiryDistributeType();
+            if (EnquiryDistributeTypeConstant.MASTER.equals(distributeType)) {
+                return Result.OK(new Page<>(pageNo, pageSize));
+            }
+            if (EnquiryDistributeTypeConstant.REGION.equals(distributeType)) {
+                List<String> countryCodes = adwebUserCountryService.getCountryCodesBySubId(loginUser.getId(), siteId);
+                if (CollectionUtils.isEmpty(countryCodes)) {
+                    return Result.OK(new Page<>(pageNo, pageSize));
+                }
+                queryWrapper.in("country_code", countryCodes);
+            }
+        }
+
+        queryWrapper.eq("status", 1);
+        queryWrapper.orderByDesc("create_time");
+        Page<AdwebEnquiryBlacklist> page = new Page<AdwebEnquiryBlacklist>(pageNo, pageSize);
+        IPage<AdwebEnquiryBlacklist> pageList = adwebEnquiryBlacklistService.page(page, queryWrapper);
+        
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param adwebEnquiryBlacklist
+     * @return
+     */
+    @AutoLog(value = "adweb_enquiry_blacklist-添加")
+    @Operation(summary = "adweb_enquiry_blacklist-添加")
+    @PostMapping(value = "/add")
+    public Result<?> add(@RequestBody AdwebEnquiryBlacklist adwebEnquiryBlacklist) {
+        adwebEnquiryBlacklistService.save(adwebEnquiryBlacklist);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 增加黑名单,从询盘中抽取出一个虚拟的人,同时将询盘放入黑名单
+     *
+     * @param adwebEnquiry 询盘
+     * @return 处理结果
+     */
+    @PostMapping(value = "/addBlacklist")
+    public Result<?> addBlacklist(@RequestBody EnquiryListDto adwebEnquiry) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+
+        //判断站点询盘黑名单是否存在添加进来的黑名单
+        QueryWrapper<AdwebSiteBlackEmail> enquirySiteBlackEmailQueryWrapper = new QueryWrapper<>();
+        enquirySiteBlackEmailQueryWrapper.eq("site_id", adwebEnquiry.getSiteId());
+        enquirySiteBlackEmailQueryWrapper.eq("status", 1);
+        enquirySiteBlackEmailQueryWrapper.eq("email", adwebEnquiry.getFromEmail());
+        List<AdwebSiteBlackEmail> enquirySiteBlackEmailList = enquirySiteBlackEmailService.list(enquirySiteBlackEmailQueryWrapper);
+
+        if (CollectionUtils.isNotEmpty(enquirySiteBlackEmailList)) {
+            Integer blackOrWhite = enquirySiteBlackEmailList.get(0).getBlackOrWhite();
+            String blackOrWhiteStr = "";
+            if (blackOrWhite == 0) {
+                blackOrWhiteStr = "黑名单";
+            } else {
+                blackOrWhiteStr = "白名单";
+            }
+            return Result.error("当前拒收的邮箱黑名单已被站点询盘黑名单记录为" + blackOrWhiteStr);
+        }
+        AdwebEnquiryBlacklist blacklist = new AdwebEnquiryBlacklist();
+        blacklist.setSiteId(adwebEnquiry.getSiteId());
+        blacklist.setEnquiryId(adwebEnquiry.getId());
+        blacklist.setName(adwebEnquiry.getContact());
+        blacklist.setEmail(adwebEnquiry.getFromEmail());
+        blacklist.setPhone(adwebEnquiry.getPhone());
+        blacklist.setWhatsapp(adwebEnquiry.getWhatsApp());
+        blacklist.setCountryCode(adwebEnquiry.getCountryCode());
+        blacklist.setCountryName(adwebEnquiry.getCountryName());
+        blacklist.setStatus(1);
+        blacklist.setCreateTime(new Date());
+        adwebEnquiryBlacklistService.save(blacklist);
+
+        UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
+        enquiryUpdateWrapper.eq("id", adwebEnquiry.getId());
+        enquiryUpdateWrapper.set("status", 0);
+        adwebEnquiryService.update(enquiryUpdateWrapper);
+
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param adwebEnquiryBlacklist
+     * @return
+     */
+    @AutoLog(value = "adweb_enquiry_blacklist-编辑")
+	@Operation(summary = "adweb_enquiry_blacklist-编辑")
+    @PutMapping(value = "/edit")
+    public Result<?> edit(@RequestBody AdwebEnquiryBlacklist adwebEnquiryBlacklist) {
+        adwebEnquiryBlacklistService.updateById(adwebEnquiryBlacklist);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "adweb_enquiry_blacklist-通过id删除")
+	@Operation(summary = "adweb_enquiry_blacklist-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        adwebEnquiryBlacklistService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 移出黑名单
+     *
+     * @param id 黑名单id
+     * @return 操作结果
+     */
+    @GetMapping(value = "/removeBlacklist")
+    public Result<?> removeBlacklist(@RequestParam(name = "id") String id) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+        UpdateWrapper<AdwebEnquiryBlacklist> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", id.split(","));
+        updateWrapper.set("status", 0);
+        adwebEnquiryBlacklistService.update(updateWrapper);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "adweb_enquiry_blacklist-批量删除")
+	@Operation(summary = "adweb_enquiry_blacklist-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.adwebEnquiryBlacklistService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "adweb_enquiry_blacklist-通过id查询")
+	@Operation(summary = "adweb_enquiry_blacklist-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
+        AdwebEnquiryBlacklist adwebEnquiryBlacklist = adwebEnquiryBlacklistService.getById(id);
+        if (adwebEnquiryBlacklist == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(adwebEnquiryBlacklist);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param adwebEnquiryBlacklist
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, AdwebEnquiryBlacklist adwebEnquiryBlacklist) {
+        return super.exportXls(request, adwebEnquiryBlacklist, AdwebEnquiryBlacklist.class, "adweb_enquiry_blacklist");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, AdwebEnquiryBlacklist.class);
+    }
+
+}

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

@@ -1,43 +1,49 @@
 package org.jeecg.modules.adweb.enquiry.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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;
 import io.swagger.v3.oas.annotations.tags.Tag;
-
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-
 import lombok.extern.slf4j.Slf4j;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.ibatis.annotations.Param;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 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.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.dto.param.AdmpEnquirySearchDto;
+import org.jeecg.modules.adweb.enquiry.constant.EnquirySendStatus;
+import org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto;
+import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.dto.param.EnquiryListSearchDto;
-import org.jeecg.modules.adweb.enquiry.dto.result.AdmpEnquiryListDto;
+import org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto;
 import org.jeecg.modules.adweb.enquiry.dto.result.EnquirySpecialFields;
 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.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
 import org.jeecg.modules.adweb.system.service.SysAdwebApi;
+import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysDictService;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
@@ -59,27 +65,40 @@ import java.util.stream.Collectors;
 @RequestMapping("/adweb/adwebEnquiry")
 @Slf4j
 public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdwebEnquiryService> {
-    @Autowired
-    private IAdwebEnquiryService adwebEnquiryService;
 
+    @Value("${enquiry.disable-admin-read:true}")
+    private Boolean disableAdminRead;
     @Value("${enquiry.demoFlag:false}")
     private Boolean demoFlag;
+    @Value("${jeecg.path.upload}")
+    private String uploadUrl;
+    @Value("${enquiry.token}")
+    private String enquiryToken;
+
+    @Resource
+    private IAdwebEnquiryService adwebEnquiryService;
 
     @Resource
     private AdwebEnquiryMapper adwebEnquiryMapper;
 
-    @Autowired
+    @Resource
     private SysAdwebApi sysAdwebApi;
 
-    @Autowired
+    @Resource
     private IAdwebSiteService adwebSiteService;
 
-    @Autowired
+    @Resource
     private ISiteUserPermissionService siteUserPermissionService;
 
-    @Autowired
+    @Resource
     private ISysDictService sysDictService;
 
+    @Resource
+    private AwsTranslateUtils awsTranslateUtils;
+
+    @Resource
+    private ISysUserService sysUserService;
+
     /**
      * 分页列表查询
      *
@@ -96,16 +115,12 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    String principalUid) {
-//
-//		String message = "Hello World";
-//		rocketMQTemplate.convertAndSend("TEST", message);
-//		System.out.println("Message sent: " + message);
 
         if (sysAdwebApi.isNotOwnSite(searchDto.getSiteId())) {
             return Result.OK(new Page<>());
         }
 
-        Page<AdmpEnquirySearchDto> page = new Page<> (pageNo, pageSize);
+        Page<EnquirySearchDto> page = new Page<> (pageNo, pageSize);
 		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
 		List<String> codeList = null;
@@ -162,7 +177,7 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
 		String userEfftecive = "(" + searchDto.getUserEffective() + ")";
 
 
-        IPage<AdmpEnquiryListDto> pageList = adwebEnquiryMapper.selectAdmpEnquiryList(page, codeList, userEfftecive, searchDto.getWasteEnquiryType(),
+        IPage<EnquiryListDto> pageList = adwebEnquiryMapper.selectAdmpEnquiryList(page, codeList, userEfftecive, searchDto.getWasteEnquiryType(),
                 searchDto.getSearchText(), searchDto.getSearchContent(), start, end, searchDto.getWhatsApp(), searchDto.getReadStatus(), principalUid, selfPrincipalUid);
 
         if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
@@ -175,7 +190,7 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
      * 处理询盘列表结果集
      * @param enquiryList
      */
-    private void dealInfo(List<AdmpEnquiryListDto> enquiryList) {
+    private void dealInfo(List<EnquiryListDto> enquiryList) {
         if (CollectionUtils.isEmpty(enquiryList)) {
             return;
         }
@@ -334,4 +349,358 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         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)) {
+            Map<String, Date> map = dealDateType(dateType);
+            start = map.get("start");
+            end = map.get("end");
+        } else {
+            if (end != null) {
+                end = DateUtil.addDays(end, 1);
+            }
+        }
+
+        List<Integer> siteIds = null;
+        if (siteId != null) {
+            String siteCode = adwebSiteService.getSiteCodeById(siteId);
+            QueryWrapper<AdwebSite> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("code", siteCode).or().eq("parent_group_code", siteCode);
+            queryWrapper.ne("status", 0);
+            List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+            siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+        } else {
+            if (sysAdwebApi.isAdmin()) {
+                QueryWrapper<AdwebSite> queryWrapper = new QueryWrapper<>();
+                queryWrapper.ne("status", 0);
+                List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
+                siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
+            } else if (sysAdwebApi.isOem()) {
+                List<String> oemGroupUids = sysAdwebApi.getOemGroupUids();
+                List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(oemGroupUids);
+                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();
+        }
+
+        QueryWrapper<AdwebEnquiry> enquiryQueryWrapper = new QueryWrapper<>();
+        enquiryQueryWrapper.eq("status", 1);
+        if (start != null) {
+            enquiryQueryWrapper.ge("record_ctime", start);
+        }
+        if (end != null) {
+            enquiryQueryWrapper.lt("record_ctime", end);
+        }
+        if (siteIds != null) {
+            enquiryQueryWrapper.in("site_id", siteIds);
+        }
+        if (StringUtils.isNotBlank(principalUid)) {
+            String finalPrincipalUid = principalUid;
+            enquiryQueryWrapper.and(wrapper -> wrapper.eq("principal_uid", finalPrincipalUid).or().eq("principal_uid", "ALL"));
+        }
+        enquiryQueryWrapper.ne("user_effective", 0);
+        int all = (int) adwebEnquiryService.count(enquiryQueryWrapper);
+
+        QueryWrapper<AdwebEnquiry> enquiryQueryWrapper1 = new QueryWrapper<>();
+        enquiryQueryWrapper1.eq("status", 1);
+        if (start != null) {
+            enquiryQueryWrapper1.ge("record_ctime", start);
+        }
+        if (end != null) {
+            enquiryQueryWrapper1.lt("record_ctime", end);
+        }
+        if (siteIds != null) {
+            enquiryQueryWrapper1.in("site_id", siteIds);
+        }
+        enquiryQueryWrapper1.eq("read_status", 0);
+        if (StringUtils.isNotBlank(principalUid)) {
+            String finalPrincipalUid = principalUid;
+            enquiryQueryWrapper1.and(wrapper -> wrapper.eq("principal_uid", finalPrincipalUid).or().eq("principal_uid", "ALL"));
+        }
+        enquiryQueryWrapper1.ne("user_effective", 0);
+        int noRead = (int) adwebEnquiryService.count(enquiryQueryWrapper1);
+
+        QueryWrapper<AdwebEnquiry> enquiryQueryWrapper2 = new QueryWrapper<>();
+        enquiryQueryWrapper2.eq("status", 1);
+        if (start != null) {
+            enquiryQueryWrapper2.ge("record_ctime", start);
+        }
+        if (end != null) {
+            enquiryQueryWrapper2.lt("record_ctime", end);
+        }
+        if (siteIds != null) {
+            enquiryQueryWrapper2.in("site_id", siteIds);
+        }
+        enquiryQueryWrapper2.eq("user_effective", 1);
+        if (StringUtils.isNotBlank(principalUid)) {
+            String finalPrincipalUid = principalUid;
+            enquiryQueryWrapper2.and(wrapper -> wrapper.eq("principal_uid", finalPrincipalUid).or().eq("principal_uid", "ALL"));
+        }
+        enquiryQueryWrapper2.ne("user_effective", 0);
+        int product = (int) adwebEnquiryService.count(enquiryQueryWrapper2);
+
+        QueryWrapper<AdwebEnquiry> enquiryQueryWrapper3 = new QueryWrapper<>();
+        enquiryQueryWrapper3.eq("status", 1);
+        if (start != null) {
+            enquiryQueryWrapper3.ge("record_ctime", start);
+        }
+        if (end != null) {
+            enquiryQueryWrapper3.lt("record_ctime", end);
+        }
+        if (siteIds != null) {
+            enquiryQueryWrapper3.in("site_id", siteIds);
+        }
+        enquiryQueryWrapper3.eq("user_effective", 2);
+        if (StringUtils.isNotBlank(principalUid)) {
+            String finalPrincipalUid = principalUid;
+            enquiryQueryWrapper3.and(wrapper -> wrapper.eq("principal_uid", finalPrincipalUid).or().eq("principal_uid", "ALL"));
+        }
+        enquiryQueryWrapper3.ne("user_effective", 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.isOem())) {
+            return Result.OK();
+        }
+        UpdateWrapper<AdwebEnquiry> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", (Object) id.split(","));
+        updateWrapper.set("read_status", 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);
+        UpdateWrapper<AdwebEnquiry> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", id);
+        updateWrapper.set("trans_content", 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(","));
+        UpdateWrapper<AdwebEnquiry> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idList);
+        updateWrapper.set("principal_uid", uid);
+        updateWrapper.set("principal_type", 1);
+        adwebEnquiryService.update(updateWrapper);
+
+        QueryWrapper<AdwebEnquiry> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("id", idList);
+        List<AdwebEnquiry> list = adwebEnquiryService.list(queryWrapper);
+        //获取站点
+        QueryWrapper<AdwebSite> adwebSiteQueryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("code",code);
+        AdwebSite adwebSite = adwebSiteService.getOne(adwebSiteQueryWrapper);
+        adwebEnquiryService.specialSendEmail(list, adwebSite);
+        //返回跟进人名称
+        for (String id: idList) {
+            AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
+            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.isOem()) {
+            uidList = sysAdwebApi.getOemGroupUids();
+        } 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      询盘信息
+     * @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;
+    }
+
+    /**
+     * 特殊时间数据处理
+     *
+     * @param dateType 时间
+     */
+    private Map<String, Date> dealDateType(String dateType) {
+        Date now = new Date();
+        Date start = null;
+        Date end = null;
+        if ("yesterday".equals(dateType)) {
+            start = DateUtil.getTodayZeroTime(DateUtil.addDays(now, -1));
+            end = DateUtil.getTodayZeroTime(now);
+        }
+        if ("today".equals(dateType)) {
+            start = DateUtil.getTodayZeroTime(now);
+            end = DateUtil.getTmrZeroTime(now);
+        }
+        if ("sevenDay".equals(dateType)) {
+            end = DateUtil.getTmrZeroTime(now);
+            start = DateUtil.addDays(end, -7);
+        }
+        if ("thirtyDay".equals(dateType)) {
+            end = DateUtil.getTmrZeroTime(now);
+            start = DateUtil.addDays(end, -30);
+        }
+        Map<String, Date> map = new HashMap<>();
+        map.put("start", start);
+        map.put("end", end);
+        return map;
+    }
+
+
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/AdmpEnquirySearchDto.java → jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquirySearchDto.java

@@ -3,7 +3,7 @@ package org.jeecg.modules.adweb.enquiry.dto.param;
 import lombok.Data;
 
 @Data
-public class AdmpEnquirySearchDto {
+public class EnquirySearchDto {
     //询盘模块类型
     private String modular;
     //阶段

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/AdmpEnquiryListDto.java → jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java

@@ -8,7 +8,7 @@ import java.util.Date;
 import java.util.List;
 
 @Data
-public class AdmpEnquiryListDto {
+public class EnquiryListDto {
     @JsonSerialize(using= ToStringSerializer.class)
     private Long id;
     //询盘编号(系统生成)

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

@@ -304,4 +304,10 @@ public class AdwebEnquiry implements Serializable {
      * */
     @TableField(exist = false)
     private String isEnquirySync;
+
+    /**
+     * 用于判断是否是·联系我们询盘·
+     * */
+    @TableField(exist = false)
+    private Integer existContactEnquiry;
 }

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

@@ -5,8 +5,8 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.adweb.enquiry.dto.param.AdmpEnquirySearchDto;
-import org.jeecg.modules.adweb.enquiry.dto.result.AdmpEnquiryListDto;
+import org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto;
+import org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
@@ -26,16 +26,41 @@ public interface AdwebEnquiryMapper extends BaseMapper<AdwebEnquiry> {
      * @param ctimeEnd
      * @return
      */
-    IPage<AdmpEnquiryListDto> selectAdmpEnquiryList(IPage<AdmpEnquirySearchDto> page,
-                                                    @Param("codeList") List<String> codeList,
-                                                    @Param("userEffective") String userEffective,
-                                                    @Param("wasteEnquiryType") String wasteEnquiryType,
-                                                    @Param("searchText") String searchText,
-                                                    @Param("searchContent") String searchContent,
-                                                    @Param("ctimeBegin") Date ctimeBegin,
-                                                    @Param("ctimeEnd") Date ctimeEnd,
-                                                    @Param("whatsApp") String whatsApp,
-                                                    @Param("readStatus") Integer readStatus,
-                                                    @Param("principalUid") String principalUid,
-                                                    @Param("selfPrincipalUid") String selfPrincipalUid);
+    IPage<EnquiryListDto> selectAdmpEnquiryList(IPage<EnquirySearchDto> page,
+                                                @Param("codeList") List<String> codeList,
+                                                @Param("userEffective") String userEffective,
+                                                @Param("wasteEnquiryType") String wasteEnquiryType,
+                                                @Param("searchText") String searchText,
+                                                @Param("searchContent") String searchContent,
+                                                @Param("ctimeBegin") Date ctimeBegin,
+                                                @Param("ctimeEnd") Date ctimeEnd,
+                                                @Param("whatsApp") String whatsApp,
+                                                @Param("readStatus") Integer readStatus,
+                                                @Param("principalUid") String principalUid,
+                                                @Param("selfPrincipalUid") String selfPrincipalUid);
+
+    /**
+     * 根据地区更新询盘跟进人
+     */
+    void updatePrincipalUidByRegion(Integer siteId, List<Integer> siteIds);
+
+    /**
+     * @param page
+     * @param siteId
+     * @param userEffective
+     * @param searchText
+     * @param ctimeBegin
+     * @param ctimeEnd
+     * @return
+     */
+    IPage<EnquiryListDto> queryWasteEnquiryList(IPage<EnquirySearchDto> page,
+                                                @Param("codeList") List<String> codeList,
+                                                @Param("siteId") String siteId,
+                                                @Param("userEffective") String userEffective,
+                                                @Param("searchText") String searchText,
+                                                @Param("ctimeBegin") String ctimeBegin,
+                                                @Param("ctimeEnd") String ctimeEnd,
+                                                @Param("whatsApp") String whatsApp,
+                                                @Param("principalUid") String principalUid);
+
 }

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

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryMapper">
 
-    <select id="selectAdmpEnquiryList" parameterType="org.jeecg.modules.adweb.enquiry.dto.param.AdmpEnquirySearchDto"
-            resultType="org.jeecg.modules.adweb.enquiry.dto.result.AdmpEnquiryListDto">
+    <select id="selectAdmpEnquiryList" parameterType="org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto"
+            resultType="org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto">
         SELECT
         t1.id,
         t2.`name` AS siteName,
@@ -109,5 +109,108 @@
         t1.record_ctime DESC
     </select>
 
+    <select id="queryWasteEnquiryList" parameterType="org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto"
+            resultType="org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto">
+        SELECT
+        t1.id,
+        t2.`name` AS siteName,
+        t1.`no`,
+        t1.no_out AS noOut,
+        t1.modular,
+        t1.record_ctime AS recordCtime,
+        t1.from_email AS fromEmail,
+        t1.country,
+        t1.site_host AS siteHost,
+        t1.uid,
+        t1.STATUS,
+        t1.tracker,
+        t1.site_code AS siteCode,
+        t1.phase,
+        t1.track_status AS trackStatus,
+        t1.replay_status AS replayStatus,
+        t1.sys_effective AS sysEffective,
+        t1.user_effective AS userEffective,
+        t1.sensitive_message AS sensitiveMessage,
+        t1.company_id AS companyId,
+        t1.contact_ids AS contactIds,
+        t1.trans_content AS transContent,
+        t1.whats_app AS whatsApp,
+        t1.name contact,
+        t1.phone,
+        t1.company formCompany,
+        t1.from_page,
+        t1.message context,
+        t1.from_page path,
+        t1.country_name as countryName,
+        t1.country_code as countryCode,
+        t1.from_ip fromIp
+        FROM
+        adweb_enquiry t1,
+        adweb_site t2
+        <where>
+            t1.site_code = t2.`code`
+            AND t2.`status` != 0 AND t1.status = 0
+            <if test="codeList != null">
+                <choose>
+                    <when test="codeList.size() != 0">
+                        AND t1.site_code IN
+                        <foreach collection="codeList" item="code" open="(" close=")" separator=",">
+                            #{code}
+                        </foreach>
+                    </when>
+                    <otherwise>
+                        AND t1.id = -1
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="null != siteId and '' != siteId">
+                and t2.id in (${siteId})
+            </if>
+            <if test="null != searchText and '' != searchText">
+                and (t1.from_email like CONCAT('%', #{searchText}, '%')
+                or t1.no like CONCAT('%', #{searchText}, '%')
+                or t1.country like CONCAT('%', #{searchText}, '%')
+                or t1.site_host like CONCAT('%', #{searchText}, '%')
+                or t1.no_out like CONCAT('%', #{searchText}, '%')
+                or t2.name like CONCAT('%', #{searchText}, '%')
+                )
+            </if>
+            <if test="userEffective != null and userEffective != '' and userEffective != 'undefined'">
+                AND t1.user_effective IN ${userEffective}
+            </if>
+            <if test="null != ctimeBegin">
+                and t1.record_ctime >= #{ctimeBegin}
+            </if>
+            <if test="null != ctimeEnd">
+                and #{ctimeEnd} > t1.record_ctime
+            </if>
+            <if test="null != whatsApp and '' != whatsApp">
+                and t1.whats_app = #{whatsApp}
+            </if>
+            <if test="principalUid != null and principalUid != ''">
+                AND (t1.principal_uid = #{principalUid} OR t1.principal_uid = 'ALL')
+            </if>
+        </where>
+        ORDER BY
+        t1.record_ctime DESC
+    </select>
+
+    <update id="updatePrincipalUidByRegion">
+        update
+        adweb_enquiry t1,
+        admp_country t2,
+        adweb_user_country t3
+        set
+        t1.principal_uid = t3.uid
+        where
+        t1.country_code = t2.country_iso_code
+        and t2.geoname_id = t3.country_id
+        and t1.site_id IN
+        <foreach collection="siteIds" item="siteId" open="(" close=")" separator=",">
+            #{siteId}
+        </foreach>
+        and t3.site_id = #{siteId}
+        and t1.principal_type != 1
+    </update>
 
 </mapper>

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

@@ -1,11 +1,13 @@
 package org.jeecg.modules.adweb.enquiry.service;
 
 import org.jeecg.modules.adweb.enquiry.dto.EnquiryDTO;
+import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 询盘信息存储表单
@@ -21,4 +23,18 @@ public interface IAdwebEnquiryService extends IService<AdwebEnquiry> {
      * 返回用户名称
      */
     void returnSalesperson (String siteCode,String inquiryId,String sales);
+
+    /**
+     * 根据地区更新询盘跟进人
+     */
+    void updatePrincipalUidByRegion(Integer siteId);
+
+    /**
+     * 更改询盘用户有效性
+     *
+     * @return
+     */
+    boolean updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto);
+
+    void specialSendEmail(List<AdwebEnquiry> enquiryList, AdwebSite adwebSite);
 }

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 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.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -16,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.constant.CacheConstant;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.DictPropertyModel;
 import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.modules.adweb.common.constant.NumConstant;
@@ -65,6 +67,9 @@ import java.util.stream.Collectors;
 public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, AdwebEnquiry> implements IAdwebEnquiryService {
 
     @Resource
+    private AdwebEnquiryMapper adwebEnquiryMapper;
+
+    @Resource
     @Lazy
     private ISysUserService sysUserService;
 
@@ -280,7 +285,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
         //特殊站点发送邮件
         List<DictPropertyModel> siteRes = sysAdwebApiImpl.queryDictInfoByDictCode("turn_inquiry_site_code");
         if (CollectionUtils.isNotEmpty(siteRes) && siteRes.get(0).getValue().equals(adwebSite.getCode())) {
-            specialSendEmail(enquiryList, adwebSite, principalEmailMap);
+            specialSendEmail(enquiryList, adwebSite);
         } else {
             String emailStr = adwebSite.getEnquiryEmailList();
             if (StringUtil.isEmpty(emailStr)) {
@@ -454,7 +459,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
                     }
                 }
             }
-            log.info("=======发送询盘邮件======");
+
             log.info("=======发送询盘邮件======");
             enquiryEmailMessageList.forEach(e -> System.out.println(e.getEmail()));
             log.info("需要添加的询盘邮件:{}", FastJsonUtil.toJSONString(enquiryEmailMessageList));
@@ -493,9 +498,8 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
      *
      * @param enquiryList
      * @param adwebSite
-     * @param principalEmailMap
      */
-    private void specialSendEmail(List<AdwebEnquiry> enquiryList, AdwebSite adwebSite, Map<String, String> principalEmailMap) {
+    public void specialSendEmail(List<AdwebEnquiry> enquiryList, AdwebSite adwebSite) {
         //通过主账号id获取子账号id集合
         List<String> idList = masterSubAccountRelationService.getSubAccountIdByMaster(adwebSite.getUid());
 
@@ -1757,4 +1761,116 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
         restTemplate.exchange(url, HttpMethod.POST, entity, String.class);
         log.info("返回跟进人名称结束");
     }
+
+    /**
+     * 根据地区更新询盘跟进人
+     */
+    @Override
+    public void updatePrincipalUidByRegion(Integer siteId) {
+        List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(siteId);
+        adwebEnquiryMapper.updatePrincipalUidByRegion(siteId, siteIds);
+    }
+
+    /**
+     * 更改询盘用户有效性
+     *
+     * @return
+     */
+    @Override
+    public boolean updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
+        String id = effectiveEnquiryParamDto.getId();
+        Integer userEffective = effectiveEnquiryParamDto.getUserEffective();
+        if (userEffective == null || StringUtil.isEmpty(id)) {
+            return false;
+        }
+
+        List<String> idList = Arrays.asList(id.split(","));
+        if (CollectionUtils.isEmpty(idList)) {
+            return false;
+        }
+
+        UpdateWrapper<AdwebEnquiry> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idList);
+        // 用户有效性  0:无效 1:有效   2 : 待定 取自字典表
+        updateWrapper.set("user_effective", userEffective);
+        // 0:不是;1:是
+        if (userEffective.equals(0)) {  // 垃圾询盘
+            String wasteEnquiryType = effectiveEnquiryParamDto.getWasteEnquiryType();
+            String wasteEnquirySeason = effectiveEnquiryParamDto.getWasteEnquirySeason();
+            updateWrapper.set("waste_enquiry", 1);
+            updateWrapper.set("waste_enquiry_type", wasteEnquiryType);
+
+            //特殊处理垃圾询盘是邮箱或者ip
+            if(wasteEnquiryType.equals("ip")){
+                updateWrapper.set("effective_reason", "人工操作-ip-" + wasteEnquirySeason);
+                adwebSiteBlackIpService.addBlackIpByContent(effectiveEnquiryParamDto);
+            }
+            if(wasteEnquiryType.equals("email")){
+                updateWrapper.set("effective_reason", "人工操作-邮箱-" + wasteEnquirySeason);
+                enquirySiteBlackEmailService.addBlackEmailByContent(effectiveEnquiryParamDto);
+            }
+            if(wasteEnquiryType.equals("keyword")){
+                updateWrapper.set("effective_reason", "人工操作-关键词-" + wasteEnquirySeason);
+                adwebSiteEnquiryRuleService.addBlackKeywordByContent(effectiveEnquiryParamDto);
+            }
+            if(wasteEnquiryType.equals("other")){
+                updateWrapper.set("effective_reason", "人工操作-其他-" + wasteEnquirySeason);
+            }
+        } else {  // 有效询盘
+            updateWrapper.set("waste_enquiry", 0);
+            updateWrapper.set("effective_reason", "人工操作");
+            updateWrapper.set("waste_enquiry_type", "");
+        }
+        this.update(updateWrapper);
+
+        if (userEffective.equals(0)) {
+            return true;
+        }
+
+        // 有效询盘发送邮件
+        try {
+            List<AdwebEnquiry> enquiryList = this.list(new LambdaQueryWrapper<AdwebEnquiry>().in(AdwebEnquiry::getId, idList));
+            if (CollectionUtils.isNotEmpty(enquiryList)) {
+                AdwebSite adwebSite = adwebSiteService.getOne(new QueryWrapper<AdwebSite>().eq("code", enquiryList.get(0).getSiteCode()));
+                if (adwebSite != null) {
+
+                    Map<String, String> principalEmailMap = new HashMap<>();
+
+                    //判断是否为产品询盘
+                    for (AdwebEnquiry adwebEnquiry : enquiryList) {
+                        if(StringUtils.isNotBlank(adwebEnquiry.getCartItems())){
+                            adwebEnquiry.setExistProductEnquiry(1);  // 产品询盘
+                        }
+                    }
+
+                    // 判断是否为联系我们询盘
+                    for (AdwebEnquiry adwebEnquiry : enquiryList) {
+                        List<DictModel> contactEnquiryWebsites = dictService.queryDictItemsByCode("send_contact_enquiry_website");
+                        List<String> contactEnquiryCodes = contactEnquiryWebsites.stream().map(DictModel::getValue).toList();
+                        if (contactEnquiryCodes.contains(adwebSite.getCode())) {
+                            if (StringUtils.isNotBlank(adwebEnquiry.getFromPage()) && adwebEnquiry.getFromPage().contains("contact")) {
+                                adwebEnquiry.setExistContactEnquiry(1);
+                            }
+                        }
+                    }
+
+                    //获取子账户
+                    List<String> subAccountIdList = masterSubAccountRelationService.getSubAccountIdByMaster(String.valueOf(adwebSite.getUid()));
+                    log.info("获取的子账户id:{}", FastJsonUtil.toJSONString(subAccountIdList));
+                    if (CollectionUtils.isNotEmpty(subAccountIdList)) {
+                        subAccountIdList.add(String.valueOf(adwebSite.getUid()));
+                        List<SysUser> principalEmailList = sysUserService.list(new QueryWrapper<SysUser>().in("id", subAccountIdList).eq("del_flag", 0).isNotNull("email").ne("email","").select("id", "email"));
+                        if (CollectionUtils.isNotEmpty(principalEmailList)) {
+                            principalEmailMap = principalEmailList.stream().collect(Collectors.toMap(SysUser::getId, SysUser::getEmail));
+
+                        }
+                    }
+                    sendValidateEmail(enquiryList, adwebSite, principalEmailMap);
+                }
+            }
+        } catch (Exception e) {
+            log.error("推送发送询盘邮件的消息失败", e);
+        }
+        return true;
+    }
 }

+ 0 - 11
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackEmailServiceImpl.java

@@ -1,27 +1,16 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
-import cn.hutool.core.date.DateUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.RedisUtil;
-import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackEmail;
-import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackIp;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebPublicBlackEmailMapper;
-import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackEmailService;
-import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackIpService;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.util.*;
-import java.util.stream.Collectors;
-
 
 /**
  * @Description: 询盘公共邮箱黑名单

+ 2 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/entity/SiteUserPermissionMapper.java → jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/mapper/SiteUserPermissionMapper.java

@@ -1,6 +1,7 @@
-package org.jeecg.modules.adweb.site.entity;
+package org.jeecg.modules.adweb.site.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.adweb.site.entity.AdwebSitePermission;
 
 /**
  * @Description: 站点和用户的中间表

+ 9 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebSiteService.java

@@ -45,7 +45,15 @@ public interface IAdwebSiteService extends IService<AdwebSite> {
      */
     List<Integer> getAllSiteIdBySiteId(Integer siteId);
 
-    public String getSiteNameByCode(String siteCode);
+    String getSiteNameByCode(String siteCode);
+
+    /**
+     * 根据用户id查询所有未删除的站点
+     *
+     * @param uid 用户id
+     * @return 站点id
+     */
+    List<Integer> getAllSiteIdByUid(String uid);
 
     /**
      * 查询全部有效的站点code

+ 31 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xkcoding.http.util.StringUtil;
+import jakarta.annotation.Resource;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
@@ -16,12 +18,12 @@ import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.entity.AdwebUserWpsite;
 import org.jeecg.modules.adweb.site.mapper.AdwebSiteMapper;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
-import org.jeecg.modules.system.mapper.SysUserRoleMapper;
 import org.jeecg.modules.adweb.site.service.IAdwebUserWpsiteService;
+import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
+import org.jeecg.modules.system.mapper.SysUserRoleMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import jakarta.annotation.Resource;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -43,6 +45,9 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
     @Autowired
     private IAdwebUserWpsiteService adwebUserWpsiteService;
 
+    @Autowired
+    private ISiteUserPermissionService siteUserPermissionService;
+
     private final RedisUtil redisUtil;
 
     public AdwebSiteServiceImpl(RedisUtil redisUtil) {
@@ -108,7 +113,7 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
                     } else {
                         config.setWordpressSetting(wordpressSettingMap.get("setting").toString());
                         List<String> open = FastJsonUtil.parseList(wordpressSettingMap.get("open").toString(), String.class);
-                        if (!open.isEmpty()) {
+                        if (CollectionUtils.isNotEmpty(open)) {
                             config.setOpenSetting(open);
                         }
                         if (wordpressSettingMap.size() > 2) {
@@ -195,6 +200,29 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
         }
         return "";
     }
+    /**
+     * 根据用户id查询所有未删除的站点
+     *
+     * @param uid 用户id
+     * @return 站点id
+     */
+    @Override
+    public List<Integer> getAllSiteIdByUid(String uid) {
+        List<AdwebSite> siteList = null;
+        try {
+            List<String> codeList = siteUserPermissionService.getSiteCodeList(uid);
+            siteList = this.list(new LambdaQueryWrapper<AdwebSite>()
+                    .ne(AdwebSite::getStatus, 0).in(AdwebSite::getCode, codeList));
+        } catch (Exception e) {
+            log.error("查询用户站点失败");
+        }
+
+        List<Integer> siteIds = new ArrayList<>();
+        for (AdwebSite site : siteList) {
+            siteIds.add(site.getId());
+        }
+        return siteIds;
+    }
 
     /** 查询全部有效的站点code */
     @Override

+ 0 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/SiteUserPermissionServiceImpl.java

@@ -4,7 +4,6 @@ package org.jeecg.modules.adweb.site.service.impl;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
 import lombok.extern.slf4j.Slf4j;
 
 import org.apache.commons.collections4.CollectionUtils;

+ 6 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java

@@ -27,6 +27,12 @@ public interface SysAdwebApi {
      */
     boolean isNotOwnSite(String siteCode);
 
+
+    /**
+     * 判断一个用户是否是adweb会员
+     */
+    boolean isAdwebVip();
+
     /**
      * 判断一个用户是否是adweb子会员
      */

+ 16 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/SysAdwebApiImpl.java

@@ -174,6 +174,22 @@ public class SysAdwebApiImpl implements SysAdwebApi {
     }
 
     /**
+     * 判断一个用户是否是adweb会员
+     */
+    @Override
+    public boolean isAdwebVip() {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String username = sysUser.getUsername();
+        List<String> roles = sysBaseAPI.getRolesByUsername(username);
+        for (String role : roles) {
+            if ("adweb_vip".equals(role)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
      * @return
      */
     @Override

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

@@ -0,0 +1,557 @@
+package org.jeecg.modules.adweb.userCountry.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.adweb.enquiry.constant.EnquiryDistributeTypeConstant;
+import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
+import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
+import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
+import org.jeecg.modules.adweb.system.service.SysAdwebApi;
+import org.jeecg.modules.adweb.userCountry.dto.DistributeCountryParam;
+import org.jeecg.modules.adweb.userCountry.dto.SubUser;
+import org.jeecg.modules.adweb.userCountry.dto.TreeOption;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebCountry;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebUserCountry;
+import org.jeecg.modules.adweb.userCountry.mapper.AdwebUserCountryMapper;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebCountryService;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebUserCountryService;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: adweb_user_country
+ * @Author: jeecg-boot
+ * @Date: 2022-08-19
+ * @Version: V1.0
+ */
+@Tag(name = "adweb_user_country")
+@RestController
+@RequestMapping("/usercountry")
+@Slf4j
+public class AdwebUserCountryController extends JeecgController<AdwebUserCountry, IAdwebUserCountryService> {
+
+    @Resource
+    private IAdwebUserCountryService adwebUserCountryService;
+
+    @Resource
+    private IAdwebSiteService adwebSiteService;
+
+    @Resource
+    private AdwebUserCountryMapper adwebUserCountryMapper;
+
+    @Resource
+    private IAdwebCountryService admpCountryService;
+
+    @Resource
+    private IAdwebEnquiryService adwebEnquiryService;
+
+    @Resource
+    private ISysBaseAPI sysBaseAPI;
+
+    @Resource
+    private SysAdwebApi sysAdwebApi;
+
+    @Resource
+    private ISysUserService sysUserService;
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param adwebUserCountry
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-分页列表查询")
+    @Operation(summary = "adweb_user_country-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(AdwebUserCountry adwebUserCountry,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                   HttpServletRequest req) {
+        QueryWrapper<AdwebUserCountry> queryWrapper = QueryGenerator.initQueryWrapper(adwebUserCountry, req.getParameterMap());
+        Page<AdwebUserCountry> page = new Page<AdwebUserCountry>(pageNo, pageSize);
+        IPage<AdwebUserCountry> pageList = adwebUserCountryService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 查询未分配地区
+     */
+    @GetMapping(value = "/undistribute")
+    public Result<?> undistribute() {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<AdwebUserCountry> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("master_uid", loginUser.getId());
+        queryWrapper.eq("status", 1);
+        List<AdwebUserCountry> userCountries = adwebUserCountryService.list(queryWrapper);
+        List<AdwebCountry> countries = null;
+        if (CollectionUtils.isEmpty(userCountries)) {
+
+        }
+        return Result.OK();
+    }
+
+    /**
+     * 获取子账户列表
+     */
+    @AutoLog(value = "询盘管理-询盘分配-子账户列表")
+    @GetMapping(value = "/subAccounts")
+    public Result<?> subAccounts(@RequestParam(name = "siteId") Integer siteId,
+                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                 @RequestParam(name = "pageSize", defaultValue = "15") Integer pageSize) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(siteId);
+        Page<SubUser> page = new Page<>(pageNo, pageSize);
+        IPage<SubUser> pageList = adwebUserCountryMapper.getSubUserList(page, loginUser.getId(), siteIds);
+        QueryWrapper<AdwebEnquiry> enquiryQueryWrapper = new QueryWrapper<>();
+        enquiryQueryWrapper.eq("status", 1);
+        enquiryQueryWrapper.in("site_id", siteIds);
+        enquiryQueryWrapper.eq("principal_type", 1);
+        int count = (int) adwebEnquiryService.count(enquiryQueryWrapper);
+        List<SubUser> list = pageList.getRecords();
+        SubUser subUser = new SubUser();
+        subUser.setId("-1");
+        subUser.setUsername("已手动分配跟进人的询盘");
+        subUser.setRealname("已手动分配跟进人的询盘");
+        subUser.setCountryNum(-1);
+        subUser.setEnquiryNum(count);
+        list.add(subUser);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 获取子账户列表
+     */
+    @GetMapping(value = "/subAccounts/options")
+    public Result<?> subAccounts2(Integer siteId, String siteCode) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // 获取主账户uid
+        String uid;
+        if (sysBaseAPI.isAdmin() || sysBaseAPI.isOem()) {
+            AdwebSite site;
+            if (siteId != null) {
+                site = adwebSiteService.getById(siteId);
+            } else {
+                site = adwebSiteService.getOne(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, siteCode));
+            }
+            if (site == null) {
+                return Result.OK(new ArrayList<SubUser>());
+            }
+            uid = site.getUid();
+        } else if (sysAdwebApi.isAdwebVip()) {
+            uid = loginUser.getId();
+        } else {
+            return Result.OK(new ArrayList<SubUser>());
+        }
+
+        // 获取子账户列表
+        List<SubUser> list = adwebUserCountryMapper.getSubUserOptions(uid);
+
+        // 如果子账户不为空,将主账户也加进去作为选项
+        if (CollectionUtils.isNotEmpty(list)) {
+            SysUser masterAccount = sysUserService.getById(uid);
+            SubUser user = new SubUser();
+            user.setId(masterAccount.getId());
+            user.setUsername(masterAccount.getRealname());
+            list.add(0, user);
+        }
+
+        return Result.OK(list);
+    }
+
+    /**
+     * 获取子账户负责的国家
+     */
+    @GetMapping(value = "/country/charge")
+    public Result<?> chargeCountry(@RequestParam String id, @RequestParam Integer siteId) {
+        QueryWrapper<AdwebUserCountry> userCountryQueryWrapper = new QueryWrapper<>();
+        userCountryQueryWrapper.eq("uid", id);
+        userCountryQueryWrapper.eq("site_id", siteId);
+        userCountryQueryWrapper.eq("status", 1);
+        List<AdwebUserCountry> userCountries = adwebUserCountryService.list(userCountryQueryWrapper);
+        if (CollectionUtils.isEmpty(userCountries)) {
+            return Result.OK();
+        }
+
+        List<Integer> countryIds = new ArrayList<>();
+        for (AdwebUserCountry userCountry : userCountries) {
+            countryIds.add(userCountry.getCountryId());
+        }
+
+        QueryWrapper<AdwebCountry> countryQueryWrapper = new QueryWrapper<>();
+        countryQueryWrapper.in("geoname_id", countryIds);
+        List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
+        if (CollectionUtils.isEmpty(countries)) {
+            return Result.OK();
+        }
+
+        // 将国家按大洲分组,然后组装成树结构
+        Map<String, List<AdwebCountry>> map = new HashMap<>();
+        for (AdwebCountry country : countries) {
+            String continentCode = country.getContinentCode();
+            List<AdwebCountry> countryList = map.computeIfAbsent(continentCode, k -> new ArrayList<>());
+            countryList.add(country);
+        }
+
+        List<TreeOption> options = new ArrayList<>();
+        for (List<AdwebCountry> countryList : map.values()) {
+            TreeOption parentOption = new TreeOption();
+            parentOption.setKey(countryList.get(0).getContinentCode());
+            parentOption.setValue(countryList.get(0).getContinentCode());
+            parentOption.setTitle(countryList.get(0).getContinentName());
+            List<TreeOption> children = new ArrayList<>();
+            for (AdwebCountry country : countryList) {
+                TreeOption option = new TreeOption();
+                option.setKey(country.getGeonameId());
+                option.setValue(country.getGeonameId());
+                option.setTitle(country.getCountryName());
+                children.add(option);
+            }
+            parentOption.setChildren(children);
+            options.add(parentOption);
+        }
+
+        return Result.OK(options);
+    }
+
+    /**
+     * 获取未分配的国家
+     */
+    @GetMapping(value = "/country/uncontribute")
+    public Result<?> uncontributeCountry(Integer siteId) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<AdwebUserCountry> userCountryQueryWrapper = new QueryWrapper<>();
+        userCountryQueryWrapper.eq("master_uid", loginUser.getId());
+        userCountryQueryWrapper.eq("status", 1);
+        userCountryQueryWrapper.eq("site_id", siteId);
+        List<AdwebUserCountry> userCountries = adwebUserCountryService.list(userCountryQueryWrapper);
+
+        List<AdwebCountry> countries;
+        if (CollectionUtils.isEmpty(userCountries)) {
+            countries = admpCountryService.list();
+        } else {
+            List<Integer> countryIds = new ArrayList<>();
+            for (AdwebUserCountry userCountry : userCountries) {
+                countryIds.add(userCountry.getCountryId());
+            }
+
+            QueryWrapper<AdwebCountry> countryQueryWrapper = new QueryWrapper<>();
+            countryQueryWrapper.notIn("geoname_id", countryIds);
+            countries = admpCountryService.list(countryQueryWrapper);
+        }
+        if (CollectionUtils.isEmpty(countries)) {
+            return Result.OK();
+        }
+
+        // 将国家按大洲分组,然后组装成树结构
+        Map<String, List<AdwebCountry>> map = new HashMap<>();
+        for (AdwebCountry country : countries) {
+            String continentCode = country.getContinentCode();
+            List<AdwebCountry> countryList = map.computeIfAbsent(continentCode, k -> new ArrayList<>());
+            countryList.add(country);
+        }
+
+        List<TreeOption> options = new ArrayList<>();
+        for (List<AdwebCountry> countryList : map.values()) {
+            TreeOption parentOption = new TreeOption();
+            parentOption.setKey(countryList.get(0).getContinentCode());
+            parentOption.setValue(countryList.get(0).getContinentCode());
+            parentOption.setTitle(countryList.get(0).getContinentName());
+            List<TreeOption> children = new ArrayList<>();
+            for (AdwebCountry country : countryList) {
+                TreeOption option = new TreeOption();
+                option.setKey(country.getGeonameId());
+                option.setValue(country.getGeonameId());
+                option.setTitle(country.getCountryName());
+                children.add(option);
+            }
+            parentOption.setChildren(children);
+            options.add(parentOption);
+        }
+
+        return Result.OK(options);
+    }
+
+    /**
+     * 分配国家
+     */
+    @PostMapping(value = "/contribute/add")
+    public Result<?> contributeCountry(@RequestBody DistributeCountryParam param) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if(sysUser.isPerform()){
+//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+//        }
+        String uid = param.getUid();
+        String countryIds = param.getCountryIds();
+        String[] countryIdArr = countryIds.split(",");
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        List<AdwebUserCountry> userCountries = new ArrayList<>();
+        for (String countryId : countryIdArr) {
+            if (StringUtils.isEmpty(countryId) || this.notNum(countryId)) {
+                continue;
+            }
+            AdwebUserCountry country = new AdwebUserCountry();
+            country.setUid(uid);
+            country.setMasterUid(loginUser.getId());
+            country.setSiteId(param.getSiteId());
+            country.setCountryId(Integer.parseInt(countryId));
+            country.setStatus(1);
+            country.setCreateTime(new Date());
+            userCountries.add(country);
+        }
+        adwebUserCountryService.saveBatch(userCountries);
+
+        // 更改相关询盘的负责人
+        QueryWrapper<AdwebCountry> countryQueryWrapper = new QueryWrapper<>();
+        countryQueryWrapper.in("geoname_id", countryIdArr);
+        List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
+        List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
+
+        List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(param.getSiteId());
+        UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
+        enquiryUpdateWrapper.in("country_code", countryCodes);
+        enquiryUpdateWrapper.in("site_id", siteIds);
+        enquiryUpdateWrapper.ne("principal_type", 1);
+        enquiryUpdateWrapper.set("principal_uid", param.getUid());
+        adwebEnquiryService.update(enquiryUpdateWrapper);
+
+        return Result.OK();
+    }
+
+    private boolean notNum(String countryId) {
+        if (countryId.charAt(0) < '1' || countryId.charAt(0) > '9') {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 分配国家
+     */
+    @PostMapping(value = "/contribute/delete")
+    public Result<?> delete(@RequestBody DistributeCountryParam param) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if(sysUser.isPerform()){
+//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+//        }
+        String uid = param.getUid();
+        String countryIds = param.getCountryIds();
+        List<String> countryIdList = new ArrayList<>();
+        if (StringUtils.isNotBlank(countryIds)) {
+            Collections.addAll(countryIdList, countryIds.split(","));
+        }
+        countryIdList.removeIf(this::notNum);
+        UpdateWrapper<AdwebUserCountry> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("uid", uid);
+        updateWrapper.eq("site_id", param.getSiteId());
+        if (CollectionUtils.isNotEmpty(countryIdList)) {
+            updateWrapper.notIn("country_id", countryIdList);
+        }
+        updateWrapper.set("status", 0);
+        adwebUserCountryService.update(updateWrapper);
+
+        // 更改相关询盘的负责人
+        List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(param.getSiteId());
+        UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
+        if (CollectionUtils.isNotEmpty(countryIdList)) {
+            QueryWrapper<AdwebCountry> countryQueryWrapper = new QueryWrapper<>();
+            countryQueryWrapper.in("geoname_id", countryIdList);
+            List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
+            List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
+            enquiryUpdateWrapper.notIn("country_code", countryCodes);
+        }
+        enquiryUpdateWrapper.in("site_id", siteIds);
+        enquiryUpdateWrapper.eq("principal_uid", param.getUid());
+        enquiryUpdateWrapper.ne("principal_type", 1);
+        enquiryUpdateWrapper.setSql("principal_uid = uid");
+        adwebEnquiryService.update(enquiryUpdateWrapper);
+        return Result.OK();
+    }
+
+    /**
+     * 更改分配方式
+     */
+    @AutoLog(value = "询盘管理-询盘分配-分配规则切换")
+    @PostMapping(value = "/updateDistributeType")
+    public Result<?> updateDistributeType(@RequestParam Integer siteId, @RequestParam String distributeType) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if(sysUser.isPerform()){
+//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+//        }
+        UpdateWrapper<AdwebSite> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", siteId);
+        updateWrapper.set("enquiry_distribute_type", distributeType);
+        adwebSiteService.update(updateWrapper);
+
+        // 修改询盘的跟进人
+        if (EnquiryDistributeTypeConstant.MASTER.equals(distributeType)) {
+            UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
+            enquiryUpdateWrapper.ne("principal_type", 1);
+            enquiryUpdateWrapper.setSql("principal_uid = uid");
+            adwebEnquiryService.update(enquiryUpdateWrapper);
+        } else if (EnquiryDistributeTypeConstant.ALL.equals(distributeType)) {
+            UpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new UpdateWrapper<>();
+            enquiryUpdateWrapper.ne("principal_type", 1);
+            enquiryUpdateWrapper.set("principal_uid", "ALL");
+            adwebEnquiryService.update(enquiryUpdateWrapper);
+        } else if (EnquiryDistributeTypeConstant.REGION.equals(distributeType)) {
+            adwebEnquiryService.updatePrincipalUidByRegion(siteId);
+        }
+        return Result.OK();
+    }
+
+    /**
+     * 更改询盘发送规则
+     */
+    @AutoLog(value = "询盘管理-询盘分配-更改询盘发送规则")
+    @PostMapping(value = "/updateSendEmailType")
+    public Result<?> updateSendEmailType(@RequestParam Integer siteId, @RequestParam String sendEmailType) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if(sysUser.isPerform()){
+//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+//        }
+        UpdateWrapper<AdwebSite> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", siteId);
+        updateWrapper.set("enquiry_send_email_type", sendEmailType);
+        adwebSiteService.update(updateWrapper);
+
+        return Result.OK();
+    }
+
+    /**
+     * 根据站点id获取站点信息
+     */
+    @GetMapping(value = "/getSiteBySiteId")
+    public Result<?> getSiteBySiteId(Integer siteId) {
+        AdwebSite site = adwebSiteService.getById(siteId);
+        return Result.OK(site);
+    }
+
+    /**
+     * 添加
+     *
+     * @param adwebUserCountry
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-添加")
+    @Operation(description = "adweb_user_country-添加")
+    @PostMapping(value = "/add")
+    public Result<?> add(@RequestBody AdwebUserCountry adwebUserCountry) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if(sysUser.isPerform()){
+//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+//        }
+        adwebUserCountryService.save(adwebUserCountry);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param adwebUserCountry
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-编辑")
+    @Operation(description = "adweb_user_country-编辑")
+    @PutMapping(value = "/edit")
+    public Result<?> edit(@RequestBody AdwebUserCountry adwebUserCountry) {
+        adwebUserCountryService.updateById(adwebUserCountry);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-通过id删除")
+    @Operation(description = "adweb_user_country-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        adwebUserCountryService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-批量删除")
+    @Operation(description = "adweb_user_country-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.adwebUserCountryService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "adweb_user_country-通过id查询")
+    @Operation(description = "adweb_user_country-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
+        AdwebUserCountry adwebUserCountry = adwebUserCountryService.getById(id);
+        if (adwebUserCountry == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(adwebUserCountry);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param adwebUserCountry
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, AdwebUserCountry adwebUserCountry) {
+        return super.exportXls(request, adwebUserCountry, AdwebUserCountry.class, "adweb_user_country");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, AdwebUserCountry.class);
+    }
+
+}

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/DistributeCountryParam.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.adweb.userCountry.dto;
+
+
+import lombok.Data;
+
+@Data
+public class DistributeCountryParam {
+
+    private String uid;
+
+    private Integer siteId;
+
+    private String countryIds;
+}

+ 21 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/SubUser.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.adweb.userCountry.dto;
+
+import lombok.Data;
+
+/**
+ * 子账户
+ */
+@Data
+public class SubUser {
+
+    private String id;
+
+    private String username;
+
+    private String realname;
+
+    private int countryNum;
+
+    private int EnquiryNum;
+}
+

+ 21 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/TreeOption.java

@@ -0,0 +1,21 @@
+package org.jeecg.modules.adweb.userCountry.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 国家选项的结构
+ */
+@Data
+public class TreeOption {
+
+    private String key;
+
+    private String value;
+
+    private String title;
+
+    private List<TreeOption> children;
+
+}

+ 54 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/entity/AdwebCountry.java

@@ -0,0 +1,54 @@
+package org.jeecg.modules.adweb.userCountry.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
+
+/**
+ * @Description: adweb_country
+ * @Author: jeecg-boot
+ * @Date:   2021-11-16
+ * @Version: V1.0
+ */
+@Data
+@TableName("adweb_country")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="admp_country")
+public class AdwebCountry implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**geonameId*/
+	@Excel(name = "geonameId", width = 15)
+    @Schema(description = "geonameId")
+    private String geonameId;
+	/**localeCode*/
+	@Excel(name = "localeCode", width = 15)
+    @Schema(description = "localeCode")
+    private String localeCode;
+	/**continentCode*/
+	@Excel(name = "continentCode", width = 15)
+    @Schema(description = "continentCode")
+    private String continentCode;
+	/**continentName*/
+	@Excel(name = "continentName", width = 15)
+    @Schema(description = "continentName")
+    private String continentName;
+	/**countryIsoCode*/
+	@Excel(name = "countryIsoCode", width = 15)
+    @Schema(description = "countryIsoCode")
+    private String countryIsoCode;
+	/**countryName*/
+	@Excel(name = "countryName", width = 15)
+    @Schema(description = "countryName")
+    private String countryName;
+	/**isInEuropeanUnion*/
+	@Excel(name = "isInEuropeanUnion", width = 15)
+    @Schema(description = "isInEuropeanUnion")
+    private String isInEuropeanUnion;
+}

+ 57 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/entity/AdwebUserCountry.java

@@ -0,0 +1,57 @@
+package org.jeecg.modules.adweb.userCountry.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+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 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: adweb_user_country
+ * @Author: jeecg-boot
+ * @Date:   2022-08-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("adweb_user_country")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="adweb_user_country")
+public class AdwebUserCountry implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @Schema(description = "id")
+    private Integer id;
+	/**用户id*/
+	@Excel(name = "用户id", width = 15)
+    @Schema(description = "用户id")
+    private String uid;
+	/**父用户id*/
+	@Excel(name = "父用户id", width = 15)
+    @Schema(description = "父用户id")
+    private String masterUid;
+    private Integer siteId;
+	/**国家id*/
+	@Excel(name = "国家id", width = 15)
+    @Schema(description = "国家id")
+    private Integer countryId;
+	/**1有效 0无效*/
+	@Excel(name = "1有效 0无效", width = 15)
+    @Schema(description = "1有效 0无效")
+    private Integer status;
+	/**创建世家*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @Schema(description = "创建世家")
+    private Date createTime;
+}

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/AdwebCountryMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.adweb.userCountry.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebCountry;
+
+/**
+ * @Description: admp_country
+ * @Author: jeecg-boot
+ * @Date:   2021-11-16
+ * @Version: V1.0
+ */
+public interface AdwebCountryMapper extends BaseMapper<AdwebCountry> {
+
+}

+ 33 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/AdwebUserCountryMapper.java

@@ -0,0 +1,33 @@
+package org.jeecg.modules.adweb.userCountry.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.jeecg.modules.adweb.userCountry.dto.SubUser;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebUserCountry;
+
+import java.util.List;
+
+/**
+ * @Description: adweb_user_country
+ * @Author: jeecg-boot
+ * @Date:   2022-08-19
+ * @Version: V1.0
+ */
+public interface AdwebUserCountryMapper extends BaseMapper<AdwebUserCountry> {
+
+    /**
+     * 获取子账户列表
+     *
+     * @param uid 父账户id
+     * @return 子账户列表
+     */
+    IPage<SubUser> getSubUserList(IPage<SubUser> page, String uid, List<Integer> siteIds);
+
+    /**
+     * 获取子账户列表2,作为下拉框选项,只需要部分字段
+     *
+     * @param uid 父账户id
+     * @return 子账户列表
+     */
+    List<SubUser> getSubUserOptions(String uid);
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/mapper/xml/AdwebCountryMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.adweb.userCountry.mapper.AdwebCountryMapper">
+
+</mapper>

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

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.adweb.userCountry.mapper.AdwebUserCountryMapper">
+
+    <select id="getSubUserList" resultType="org.jeecg.modules.adweb.userCountry.dto.SubUser">
+        SELECT
+            t0.sub_id id,
+            t4.username,
+            t4.realname,
+            COUNT(DISTINCT t1.country_id) countryNum,
+            enquiryCount enquiryNum
+        FROM
+            master_sub_account_relation t0
+            LEFT JOIN adweb_user_country t1 ON t0.sub_id = t1.uid AND t1.`status` = 1 AND t1.site_id IN
+            <foreach collection="siteIds" open="(" close=")" separator="," item="siteId">
+                #{siteId}
+            </foreach>
+            LEFT JOIN admp_country t2 ON t1.country_id = t2.geoname_id
+            LEFT JOIN
+            (
+                SELECT
+                    COUNT(id) enquiryCount,
+                    principal_uid
+                FROM
+                    adweb_enquiry
+                WHERE
+                    `status` = 1 AND site_id IN
+                    <foreach collection="siteIds" open="(" close=")" separator="," item="siteId">
+                        #{siteId}
+                    </foreach>
+                GROUP BY
+                    principal_uid
+            ) t3 ON t0.sub_id = t3.principal_uid
+            LEFT JOIN sys_user t4 ON t0.sub_id = t4.id
+        WHERE
+            t0.`status` = 1
+            AND t0.master_id = #{uid}
+        GROUP BY
+            t0.sub_id
+    </select>
+    <select id="getSubUserOptions" resultType="org.jeecg.modules.adweb.userCountry.dto.SubUser">
+        SELECT
+            t1.id,
+            t1.realname username
+        FROM
+            master_sub_account_relation t0,
+            sys_user t1
+        WHERE
+            t0.sub_id = t1.id
+            AND t0.`status` = 1
+            AND t1.del_flag = 0
+            AND t1.status = 1
+            AND t0.master_id = #{uid}
+    </select>
+</mapper>

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebCountryService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.adweb.userCountry.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebCountry;
+
+/**
+ * @Description: admp_country
+ * @Author: jeecg-boot
+ * @Date:   2021-11-16
+ * @Version: V1.0
+ */
+public interface IAdwebCountryService extends IService<AdwebCountry> {
+
+}

+ 33 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebUserCountryService.java

@@ -0,0 +1,33 @@
+package org.jeecg.modules.adweb.userCountry.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebUserCountry;
+
+import java.util.List;
+
+/**
+ * @Description: adweb_user_country
+ * @Author: jeecg-boot
+ * @Date:   2022-08-19
+ * @Version: V1.0
+ */
+public interface IAdwebUserCountryService extends IService<AdwebUserCountry> {
+
+    /**
+     * 根据子账户的id获取分配给其负责的国家列表
+     *
+     * @param id 子账户id
+     * @return 国家id列表
+     */
+    List<Integer> getCountryIdsBySubId(String id);
+
+    /**
+     * 根据子账户的id获取分配给其负责的国家列表
+     *
+     * @param id     子账户id
+     * @param siteId 站点id
+     * @return 国家code列表
+     */
+    List<String> getCountryCodesBySubId(String id, Integer siteId);
+
+}

+ 18 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebCountryServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.adweb.userCountry.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebCountry;
+import org.jeecg.modules.adweb.userCountry.mapper.AdwebCountryMapper;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebCountryService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Description: admp_country
+ * @Author: jeecg-boot
+ * @Date:   2021-11-16
+ * @Version: V1.0
+ */
+@Service
+public class AdwebCountryServiceImpl extends ServiceImpl<AdwebCountryMapper, AdwebCountry> implements IAdwebCountryService {
+
+}

+ 68 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebUserCountryServiceImpl.java

@@ -0,0 +1,68 @@
+package org.jeecg.modules.adweb.userCountry.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import jakarta.annotation.Resource;
+import org.apache.commons.collections4.CollectionUtils;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebCountry;
+import org.jeecg.modules.adweb.userCountry.entity.AdwebUserCountry;
+import org.jeecg.modules.adweb.userCountry.mapper.AdwebUserCountryMapper;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebCountryService;
+import org.jeecg.modules.adweb.userCountry.service.IAdwebUserCountryService;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: adweb_user_country
+ * @Author: jeecg-boot
+ * @Date:   2022-08-19
+ * @Version: V1.0
+ */
+@Service
+public class AdwebUserCountryServiceImpl extends ServiceImpl<AdwebUserCountryMapper, AdwebUserCountry> implements IAdwebUserCountryService {
+
+    @Resource
+    private IAdwebCountryService adwebCountryService;
+
+    /**
+     * 根据子账户的id获取分配给其负责的国家列表
+     *
+     * @param id 子账户id
+     * @return 国家id列表
+     */
+    @Override
+    public List<Integer> getCountryIdsBySubId(String id) {
+        QueryWrapper<AdwebUserCountry> queryWrapper = new QueryWrapper<AdwebUserCountry>()
+                .select("country_id")
+                .eq("uid", id)
+                .eq("status", 1);
+        List<AdwebUserCountry> list = this.list(queryWrapper);
+        if (CollectionUtils.isEmpty(list)) {
+            return new ArrayList<>();
+        }
+        return list.stream().map(AdwebUserCountry::getCountryId).collect(Collectors.toList());
+    }
+
+    /**
+     * 根据子账户的id获取分配给其负责的国家列表
+     *
+     * @param id     子账户id
+     * @param siteId 站点id
+     * @return 国家code列表
+     */
+    @Override
+    public List<String> getCountryCodesBySubId(String id, Integer siteId) {
+        List<Integer> countryIds = this.getCountryIdsBySubId(id);
+        if (CollectionUtils.isEmpty(countryIds)) {
+            return new ArrayList<>();
+        }
+        QueryWrapper<AdwebCountry> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("geoname_id", countryIds);
+        List<AdwebCountry> countries = adwebCountryService.list(queryWrapper);
+        return countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
+    }
+
+}

+ 12 - 0
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -395,3 +395,15 @@ dataforseo:
   password: 0845d3de83295cca
   api-path: https://api.dataforseo.com
 
+### 询盘列表配置
+enquiry:
+  disable-admin-read: true
+  demoFlag: false
+  token: zQ3jJqtIexedIw6tZGk6p
+  pullCount: 5
+
+# 亚马逊翻译api
+aws:
+  translate:
+    accessKey: AKIAS37NJDKDETZ7PPEN
+    secretKey: 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

+ 12 - 0
jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml

@@ -383,3 +383,15 @@ dataforseo:
   password: 0845d3de83295cca
   api-path: https://api.dataforseo.com
 
+### 询盘列表配置
+enquiry:
+  disable-admin-read: true
+  demoFlag: false
+  token: zQ3jJqtIexedIw6tZGk6p
+  pullCount: 5
+
+# 亚马逊翻译api
+aws:
+  translate:
+    accessKey: AKIAS37NJDKDETZ7PPEN
+    secretKey: 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