diff --git a/ms-biz/src/main/java/com/ms/api/spi/move/FailRetryMoveTasksService.java b/ms-biz/src/main/java/com/ms/api/spi/move/FailRetryMoveTasksService.java index e67eeb1e..87eb1b12 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/move/FailRetryMoveTasksService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/move/FailRetryMoveTasksService.java @@ -1,7 +1,9 @@ package com.ms.api.spi.move; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.doudian.open.gson.Gson; import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; import com.jinritemai.cloud.base.api.ExtensionService; @@ -43,6 +45,8 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi private MoveCollectTaskService moveCollectTaskService; @Autowired private MoveProductPublishBufferService moveProductPublishBufferService; + @Autowired + private MoveShopSettingService moveShopSettingService; @Override public BaseResponse handle(BaseRequest req) { @@ -97,10 +101,16 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi } MoveCollectTask moveCollectTask = moveCollectTaskService.getMoveCollectTask(moveCollectTaskDetail.getMoveCollectTaskId(), shopId); - if (BeanUtil.isEmpty(moveCollectTask.getCondition())) { + String condition=moveCollectTask.getCondition(); + if (BeanUtil.isEmpty(condition)) { return R.fail("未找到配置信息!无法重试,请使用链接重新搬家!"); } + MoveShopSetting shopMoveCondition = moveShopSettingService.getDetailByShopId(shopId); + shopMoveCondition.setSkipSeason(reason); + String shopMoveConditionStr = JSON.toJSONString(shopMoveCondition); + + if (Objects.equals(moveCollectTaskDetail.getStatus(), StatusConst.fail) || Objects.equals(moveCollectTaskDetail.getStatus(), StatusConst.cancel) || Objects.equals(moveCollectTaskDetail.getStatus(), StatusConst.delete) || Objects.equals(moveCollectTaskDetail.getStatus(), StatusConst.skip)) { MoveCollectTaskDetail moveCollectTaskDetail1 = new MoveCollectTaskDetail(); @@ -114,7 +124,7 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi MoveCollectTask moveCollectTask1 = new MoveCollectTask(); moveCollectTask1.setMoveCollectTaskId(moveCollectTask.getMoveCollectTaskId()); moveCollectTask1.setGmtModified(new Date()); - moveCollectTask1.setCondition(moveCollectTask.getCondition()); + moveCollectTask1.setCondition(shopMoveConditionStr); moveCollectTaskService.updateByPrimaryKey(moveCollectTask1); int priority = getTaskPriority(shopId);