Преглед на файлове

feat(store): 更新差评申诉状态处理逻辑

- 新增处理中状态值3用于标识申诉正在处理
- 修改查询条件过滤已处理和无效记录
- 调整历史记录查询逻辑以兼容新状态分类
- 更新配置注入方式统一管理第三方URL
- 优化任务执行流程提升系统稳定性
qrs преди 5 дни
родител
ревизия
32b6edee1d

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/StoreCommentAppeal.java

@@ -43,7 +43,7 @@ public class StoreCommentAppeal extends Model<StoreCommentAppeal> {
     @TableField("img_id")
     private String imgId;
 
-    @ApiModelProperty(value = "申诉状态: 0:待处理, 1:已驳回, 2:已同意")
+    @ApiModelProperty(value = "申诉状态: 0:待处理, 1:已驳回, 2:已同意, 3:处理中")
     @TableField("appeal_status")
     private Integer appealStatus;
 

+ 2 - 2
alien-entity/src/main/java/shop/alien/mapper/StoreCommentAppealMapper.java

@@ -76,13 +76,13 @@ public interface StoreCommentAppealMapper extends BaseMapper<StoreCommentAppeal>
             "LEFT JOIN store_comment sc ON sca.comment_id = sc.id " +
             "LEFT JOIN store_img si ON sca.img_id = si.id " +
             "LEFT JOIN (SELECT sc.id id, si.img_url user_img_url FROM store_comment sc LEFT JOIN store_img si ON sc.img_id = si.id AND sc.delete_flag = 0) sci ON sci.id = sca.comment_id " +
-            "WHERE sca.appeal_status = 0 AND sca.delete_flag = 0")
+            "WHERE sca.appeal_status = 0 and record_id is null AND sca.delete_flag = 0")
     List<Map<String, Object>> getAppealList();
 
 
     @Select("SELECT sca.id, sca.appeal_status, sca.final_result, sca.comment_id, sca.record_id " +
             "FROM store_comment_appeal sca " +
-            "WHERE sca.appeal_status = 0")
+            "WHERE sca.appeal_status = 3")
     List<StoreCommentAppeal> getPendingAppeals();
 
     @Update("UPDATE store_comment_appeal " +

+ 7 - 7
alien-job/src/main/java/shop/alien/job/store/BadReviewAppealJob.java

@@ -56,20 +56,20 @@ public class BadReviewAppealJob {
 //    @Value("${third-party-login.base-url}")
 //    private String loginUrl;
 
-    private String loginUrl = "http://192.168.2.78:9000/ai/user-auth-core/api/v1/auth/login";
-
-
     @Value("${third-party-user-name.base-url}")
     private String userName;
 
     @Value("${third-party-pass-word.base-url}")
     private String passWord;
 
-    private String analyzeUrl = "http://192.168.2.78:9000/ai/auto-review/api/v1/analyze";
-
-    private String resultUrl = "http://192.168.2.78:9000/ai/auto-review";
+    @Value("${third-party-login.base-url}")
+    private String loginUrl;
 
+    @Value("${third-party-analyzeUrl.base-url}")
+    private String analyzeUrl;
 
+    @Value("${third-party-resultUrl.base-url}")
+    private String resultUrl;
 
     /**
      * 差评申述置信度分析接口地址
@@ -299,7 +299,7 @@ public class BadReviewAppealJob {
                 //修改评论状态为"处理中"
                 StoreCommentAppeal sCommentAppeal = new StoreCommentAppeal();
                 sCommentAppeal.setId((Integer) storeCommentAppeal.get("id"));
-                sCommentAppeal.setAppealStatus(0);
+                sCommentAppeal.setAppealStatus(3);
                 sCommentAppeal.setRecordId(recordId);
                 storeCommentAppealMapper.updateById(sCommentAppeal);
 

+ 10 - 1
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentAppealServiceImpl.java

@@ -94,9 +94,18 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
     public IPage<StoreCommentAppealVo> getAppealHistory(Integer pageNum, Integer pageSize, Integer storeId, String appealStatus) {
         QueryWrapper<StoreCommentAppealVo> wrapper = new QueryWrapper<>();
         wrapper.eq("a.store_id", storeId)
-                .eq(!appealStatus.isEmpty() && !"null".equals(appealStatus), "a.appeal_status", appealStatus)
+//                .eq(!appealStatus.isEmpty() && !"null".equals(appealStatus), "a.appeal_status", appealStatus)
                 .eq("a.delete_flag", 0)
                 .orderByDesc("a.created_time");
+
+        if (StringUtils.isNotEmpty(appealStatus) && !"null".equals(appealStatus)) {
+            if ("0".equals(appealStatus)) {
+                wrapper.in("a.appeal_status", 0, 3);
+            } else {
+                wrapper.eq("a.appeal_status", appealStatus);
+            }
+        }
+
         IPage<StoreCommentAppealVo> storeCommentAppealPage = storeCommentAppealMapper.getStoreCommentAppealPage(new Page<>(pageNum, pageSize), wrapper);
         storeCommentAppealPage.getRecords().forEach(item -> {
             String[] split = item.getImgId().split(",");