Commit 5bd654e7 by 林冲 Committed by 崔彦峰

feat(carcondition): 新增AI报告失败状态并优化任务处理逻辑

- 添加 GENERATED_FAIL(3, "生成失败") 枚举值到 CarConditionAiReportStatusEnum
- 创建 CarConditionAIRespDTO 数据传输对象用于AI报告响应
- 更新 CarConditionAiReportService 中的导入包和响应类型转换
- 修改 CarConditionAIRespDTO 类型替换原有的 CarConditionRespDTO
- 调整定时任务轮询间隔从每30秒改为每分钟执行一次
- 在 CarConditionAiReportTaskJobService 中添加事务注解支持
- 实现 updateAIReportFailTask 方法统一处理AI报告失败情况
- 添加 updateAIReportTask 和 updateCarConditionAIReportStatus 辅助方法
- 重构 processTask 方法中的API配置和响应处理逻辑
- 移除未使用的导入包和过时的代码片段
- 统一错误处理机制确保任务状态正确更新
1 parent ff23b86d
package com.gsc4cloud.gsc.vpc.api.dto.resdto.carcondition;
import lombok.Data;
import java.io.Serializable;
@Data
public class CarConditionAIRespDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 业务Id
*/
private String businessId;
/**
* 异步请求是否完成
*/
private boolean taskFinished;
/**
* 是否成功
*/
private boolean success;
/**
* 返回编码
*/
private int code;
/**
* 响应内容
*/
private String message;
/**
* 失败错误描述
*/
private String error;
}
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,8 @@ public enum CarConditionAiReportStatusEnum { ...@@ -14,7 +14,8 @@ public enum CarConditionAiReportStatusEnum {
NOT_GENERATED(0, "未生成"), NOT_GENERATED(0, "未生成"),
GENERATING(1, "生成中"), GENERATING(1, "生成中"),
GENERATED(2, "已生成"); GENERATED(2, "已生成"),
GENERATED_FAIL(3, "生成失败");
private final Integer code; private final Integer code;
private final String description; private final String description;
......
...@@ -42,6 +42,12 @@ public class AddJoinWayRequest implements Serializable { ...@@ -42,6 +42,12 @@ public class AddJoinWayRequest implements Serializable {
private java.util.List<String> chatIdList; private java.util.List<String> chatIdList;
/** /**
* 群名称
*/
@Schema(description = "群名称")
private String chatName;
/**
* 企业自定义的state参数,用于区分不同的应用等,最多30个字符 * 企业自定义的state参数,用于区分不同的应用等,最多30个字符
*/ */
@Schema(description = "企业自定义的state参数,用于回调溯源") @Schema(description = "企业自定义的state参数,用于回调溯源")
......
...@@ -26,4 +26,28 @@ public class AddJoinWayResponse implements Serializable { ...@@ -26,4 +26,28 @@ public class AddJoinWayResponse implements Serializable {
@Schema(description = "新增的进群方式配置ID") @Schema(description = "新增的进群方式配置ID")
private String configId; private String configId;
/**
* 群活码链接
*/
@Schema(description = "群活码链接")
private String groupCodeUrl;
/**
* 业务类型
*/
@Schema(description = "业务类型")
private String businessType;
/**
* 是否成功
*/
@Schema(description = "是否成功")
private Boolean success;
/**
* 错误信息
*/
@Schema(description = "错误信息")
private String errorMessage;
} }
...@@ -26,5 +26,33 @@ public class GetJoinWayResponse implements Serializable { ...@@ -26,5 +26,33 @@ public class GetJoinWayResponse implements Serializable {
@Schema(description = "联系二维码的URL") @Schema(description = "联系二维码的URL")
private String qrCode; private String qrCode;
// 可能包含详细的 config 信息,视业务需要 /**
* 进群方式(二维码链接)
*/
@Schema(description = "群活码链接")
private String groupCodeUrl;
/**
* 配置ID
*/
@Schema(description = "配置ID")
private String configId;
/**
* 业务类型
*/
@Schema(description = "业务类型")
private String businessType;
/**
* 是否成功
*/
@Schema(description = "是否成功")
private Boolean success;
/**
* 错误信息
*/
@Schema(description = "错误信息")
private String errorMessage;
} }
package com.gsc4cloud.gsc.vpc.api.util; package com.gsc4cloud.gsc.vpc.api.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class OssUtils { public class OssUtils {
@Value("${oss.preview}") public static String convertDownloadUrlToPreviewUrl(String downloadUrl, String previewUrl) {
private String previewUrl;
public String convertDownloadUrlToPreviewUrl(String downloadUrl) {
int i = downloadUrl.indexOf("://"); int i = downloadUrl.indexOf("://");
if (i < 0) return downloadUrl; if (i < 0) return downloadUrl;
i += 3; i += 3;
...@@ -17,9 +11,9 @@ public class OssUtils { ...@@ -17,9 +11,9 @@ public class OssUtils {
return j < 0 ? previewUrl : previewUrl + downloadUrl.substring(j); return j < 0 ? previewUrl : previewUrl + downloadUrl.substring(j);
} }
// public static void main(String[] args) { public static void main(String[] args) {
// System.out.println(convertDownloadUrlToPreviewUrl( System.out.println(convertDownloadUrlToPreviewUrl(
// "https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/livecode/qrcode_4729FB_1774526596476.png", "https://jinrong-huidan-test.oss-cn-shenzhen.aliyuncs.com/webmirror/report_1767578351203.html",
// "https://jinrong-huidan-test.glsx.com.cn")); "https://jinrong-huidan-test.glsx.com.cn"));
// } }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!