BUGFIX: cloud;

This commit is contained in:
shahaibo
2025-06-13 15:09:32 +08:00
parent b6c43e534b
commit 4cca30ec75
2 changed files with 68 additions and 30 deletions

View File

@@ -30,6 +30,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Slf4j
@@ -378,12 +379,14 @@ public class GenerateConsumer {
log.info("task_id : {} start ", generateResult.get("task_id"));
if (!StringUtils.isEmpty(generateResult.getString("progress"))) {
String progress = generateResult.getString("progress");
JSONObject result = generateResult.getJSONObject("result");
String url = null;
if (!progress.equals("OK") && !StringUtils.isEmpty(result)) {
url = result.getString("product_img");
String taskId = generateResult.getString("task_id");
userLikeGroupService.toProductBatch(taskId, url, progress);
if (!progress.startsWith("0") && !progress.equals("OK")) {
JSONObject result = generateResult.getJSONObject("result");
if (Objects.nonNull(result)) {
url = result.getString("product_img");
String taskId = generateResult.getString("task_id");
userLikeGroupService.toProductBatch(taskId, url, progress);
}
}
} else {
// 修改redis中的数据状态为exception
@@ -429,12 +432,14 @@ public class GenerateConsumer {
log.info("task_id : {} start ", generateResult.get("task_id"));
if (!StringUtils.isEmpty(generateResult.getString("progress"))) {
String progress = generateResult.getString("progress");
JSONObject result = generateResult.getJSONObject("result");
String url = null;
if (!StringUtils.isEmpty(result)) {
url = result.getString("relight_img");
String taskId = generateResult.getString("task_id");
userLikeGroupService.relightBatch(taskId, url, progress);
if (!progress.startsWith("0") && !progress.equals("OK")) {
JSONObject result = generateResult.getJSONObject("result");
if (Objects.nonNull(result)) {
url = result.getString("relight_img");
String taskId = generateResult.getString("task_id");
userLikeGroupService.relightBatch(taskId, url, progress);
}
}
} else {
// 修改redis中的数据状态为exception
@@ -604,21 +609,21 @@ public class GenerateConsumer {
public void getDesignBatchResult(Message msg, Channel channel) {
processDesignBatchResult(msg, channel);
}
// @RabbitListener(queues = "#{rabbitMQProperties.queues.toProductImageBatch}")
// @RabbitHandler
// public void getToProductImageBatchResult(Message msg, Channel channel) {
// processToProductImageBatchResult(msg, channel);
// }
//
// @RabbitListener(queues = "#{rabbitMQProperties.queues.relightBatch}")
// @RabbitHandler
// public void getRelightBatchResult(Message msg, Channel channel) {
// processRelightBatchResult(msg, channel);
// }
//
// @RabbitListener(queues = "#{rabbitMQProperties.queues.poseTransformBatch}")
// @RabbitHandler
// public void getPoseTransformBatchResult(Message msg, Channel channel) {
// processPoseTransformBatchResult(msg, channel);
// }
@RabbitListener(queues = "#{rabbitMQProperties.queues.toProductImageBatch}")
@RabbitHandler
public void getToProductImageBatchResult(Message msg, Channel channel) {
processToProductImageBatchResult(msg, channel);
}
@RabbitListener(queues = "#{rabbitMQProperties.queues.relightBatch}")
@RabbitHandler
public void getRelightBatchResult(Message msg, Channel channel) {
processRelightBatchResult(msg, channel);
}
@RabbitListener(queues = "#{rabbitMQProperties.queues.poseTransformBatch}")
@RabbitHandler
public void getPoseTransformBatchResult(Message msg, Channel channel) {
processPoseTransformBatchResult(msg, channel);
}
}