1
0

4 Коммиты 4f183a05e9 ... 89328ddc46

Автор SHA1 Сообщение Дата
  zq940222 89328ddc46 seo管理 关键词管理调整 21 часов назад
  chenpeiqing 6e0e601466 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 дней назад
  chenlei1231 9f52261cd6 上传目录生产配置 2 дней назад
  zhangqiang 11c94a1946 Merge branch 'dev-zenas-20241018' of wangfan/adweb3-server into master 4 дней назад

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

@@ -256,25 +256,26 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
         judgeBlacklist(adwebEnquiryList);
 
         if (!adwebEnquiryList.isEmpty()) {
+            AdwebEnquiry target = adwebEnquiryList.get(0);
             try {
-                AdwebEnquiry target = adwebEnquiryList.get(0);
                 this.save(target);
                 adwebEnquiryFormService.save(form);
 
-
-                // 给该站点所属的用户发送消息
-                AdwebSite targetSite = adwebSiteService.getSiteByCode(target.getSiteCode());
-                String[] userIds = targetSite.getUid().split(",");
-                // TODO 之后仅对有效询盘进行发送消息通知
-                JSONObject obj = new JSONObject();
-                obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_ENQUIRY);
-                obj.put(WebsocketConst.MSG_TXT, "您已经收到询盘,请尽快处理");
-                webSocket.sendMessage(userIds, obj.toJSONString());
-
             } catch (Exception e) {
                 log.error("站点为:{},  recordId为:{} 保存询盘到数据库失败,原因是:{}", adwebSite.getName(), enquiryDto.getRecordId(), e.getMessage());
             }
 
+            // 给该站点所属的用户发送消息
+            AdwebSite targetSite = adwebSiteService.getSiteByCode(target.getSiteCode());
+            SysUser sysUser = sysUserService.getUserByName("admin");
+            String[] userIds = {targetSite.getUid(), sysUser.getId()};
+
+            // TODO 之后仅对有效询盘进行发送消息通知
+            JSONObject obj = new JSONObject();
+            obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_ENQUIRY);
+            obj.put(WebsocketConst.MSG_TXT, "您已经收到询盘,请尽快处理");
+            webSocket.sendMessage(userIds, obj.toJSONString());
+
             // 发送询盘邮件
             sendValidateEmail(adwebEnquiryList, adwebSite, principalEmailMap);
         }

+ 20 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java

@@ -25,10 +25,13 @@ 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.config.security.utils.SecureUtil;
+import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
+import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -58,6 +61,8 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 
     @Autowired private ISysBaseAPI sysBaseAPI;
 
+    @Autowired private IAdwebSiteService adwebSiteService;
+
     /**
      * 分页列表查询
      *
@@ -103,9 +108,19 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-添加")
     @Operation(summary = "关键词-添加")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:add')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:add')")
     @PostMapping(value = "/add")
     public Result<String> add(@RequestBody SeoKeywords seoKeywords) {
+        AdwebSite siteByCode = adwebSiteService.getSiteByCode(seoKeywords.getSiteCode());
+        if (siteByCode == null) {
+            return Result.error("未找到对应站点");
+        }
+        seoKeywords.setAppKey(AdwebConstant.APPKEY);
+        // 根据siteCode获取站点域名
+        String domain = siteByCode.getDomain();
+        seoKeywords.setDomain(domain);
+        seoKeywords.setStatus(1);
+        seoKeywords.setLang("en");
         seoKeywordsService.save(seoKeywords);
         return Result.OK("添加成功!");
     }
@@ -118,7 +133,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-编辑")
     @Operation(summary = "关键词-编辑")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:edit')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:edit')")
     @RequestMapping(
             value = "/edit",
             method = {RequestMethod.PUT, RequestMethod.POST})
@@ -135,7 +150,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-通过id删除")
     @Operation(summary = "关键词-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:delete')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:delete')")
     @DeleteMapping(value = "/delete")
     public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
         seoKeywordsService.removeById(id);
@@ -150,7 +165,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-批量删除")
     @Operation(summary = "关键词-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:deleteBatch')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:deleteBatch')")
     @DeleteMapping(value = "/deleteBatch")
     public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         this.seoKeywordsService.removeByIds(Arrays.asList(ids.split(",")));
@@ -179,7 +194,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      *
      * @param request
      */
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:exportXls')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:exportXls')")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request) throws Exception {
         // Step.1 组装查询条件

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKeywords.java

@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -101,6 +102,7 @@ public class SeoKeywords implements Serializable {
 	/**关键词类型(1:指定;2:长尾)*/
 	@Excel(name = "关键词类型(1:指定;2:长尾)", width = 15)
     @Schema(description = "关键词类型(1:指定;2:长尾)")
+    @Dict(dicCode = "keyword_type")
     private Integer keywordType;
 	/**最近一次搜索排名*/
 	@Excel(name = "最近一次搜索排名", width = 15)

+ 2 - 3
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -230,9 +230,9 @@ jeecg:
     app: http://localhost:8051
   path:
     #文件上传根目录 设置
-    upload: D:/Advich/Project/Adweb3.0
+    upload: D:/ProjectsCode/adweb3-server/upload
     #webapp文件路径
-    webapp: D:/Advich/Project/Adweb3.0
+    webapp: D:/ProjectsCode/adweb3-server/upload
   #阿里云oss存储和大鱼短信秘钥配置
   oss:
     accessKey: ??
@@ -315,7 +315,6 @@ logging:
   level:
     org.flywaydb: debug
     org.jeecg.modules.system.mapper: info
-    root: debug
 #swagger
 knife4j:
   #开启增强配置

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

@@ -231,9 +231,9 @@ jeecg:
     app: http://localhost:8051
   path:
     #文件上传根目录 设置
-    upload: /opt/jeecg-boot/upload
+    upload: /opt/adweb3/upload
     #webapp文件路径
-    webapp: /opt/jeecg-boot/webapp
+    webapp: /opt/adweb3/webapp
   #阿里云oss存储和大鱼短信秘钥配置
   oss:
     accessKey: ??
@@ -362,7 +362,7 @@ data-bridge:
 geoip:
   static:
     city:
-      mmdb: /home/adweb/adweb3/sharing/GeoLite2-City.mmdb
+      mmdb: /opt/adweb3/sharing/GeoLite2-City.mmdb
 
 # 机器人预警url
 robot: