diff --git a/ms-api/src/main/java/com/ms/api/dto/move/BatchDeleteTaskDetailRequestDTO.java b/ms-api/src/main/java/com/ms/api/dto/move/BatchDeleteTaskDetailRequestDTO.java index 70d85ec4..40cecb54 100644 --- a/ms-api/src/main/java/com/ms/api/dto/move/BatchDeleteTaskDetailRequestDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/move/BatchDeleteTaskDetailRequestDTO.java @@ -18,10 +18,10 @@ public class BatchDeleteTaskDetailRequestDTO { /** * 删除对应商品 */ - private int deleteProduct; + private int deleteProduct = 0; /** * 在售商品也删除 */ - private int deleteOnSaleProduct; + private int deleteOnSaleProduct = 0; } 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 87eb1b12..66c297b2 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 @@ -8,6 +8,7 @@ import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; import com.jinritemai.cloud.base.api.ExtensionService; import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.biz.SaveBatchMoveTaskBizService; import com.ms.api.common.R; import com.ms.api.common.Ret; import com.ms.api.common.SPIBaseService; @@ -47,6 +48,8 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi private MoveProductPublishBufferService moveProductPublishBufferService; @Autowired private MoveShopSettingService moveShopSettingService; + @Autowired + private SaveBatchMoveTaskBizService saveBatchMoveTaskBizService; @Override public BaseResponse handle(BaseRequest req) { @@ -61,8 +64,8 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi int processCount = 0; for (int i = 0; i < size; i++) { Long detailId = taskDetailIds.get(i); - BaseResponse rsp = this.retryMoveTask(detailId, shopId, ""); - if (Objects.equals(rsp.getCode(), "10000")) { + Ret retryRet = this.retryMoveTask(detailId, shopId, ""); + if (retryRet.getResult().equals("success")) { processCount++; } } @@ -86,10 +89,10 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi return R.fail("操作失败"); } - private BaseResponse retryMoveTask(Long detailId, Long shopId, String reason) { - BaseResponse checkAndGetConfigIdRet = this.checkAvailableCopyAndGetMoveConfigId(detailId, 1); - if (!Objects.equals(checkAndGetConfigIdRet.getCode(), "10000")) { - //返回失败则直接返回 + private Ret retryMoveTask(Long detailId, Long shopId, String reason) { + int needAddCnt = 1; + Ret checkAndGetConfigIdRet = saveBatchMoveTaskBizService.checkAvailableCopyAndGetMoveConfigId(detailId, needAddCnt); + if (checkAndGetConfigIdRet.getResult().equals("fail")) { return checkAndGetConfigIdRet; } String curMonth = CommonTool.getCurMonthLastTime(); @@ -97,13 +100,13 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi MoveCollectTaskDetail moveCollectTaskDetail = moveCollectTaskDetailService.getMoveCollectTaskDetail(shopId, detailId); if (moveCollectTaskDetail == null) { - return R.fail("任务不存在"); + return CommonTool.failResult("任务不存在"); } MoveCollectTask moveCollectTask = moveCollectTaskService.getMoveCollectTask(moveCollectTaskDetail.getMoveCollectTaskId(), shopId); String condition=moveCollectTask.getCondition(); if (BeanUtil.isEmpty(condition)) { - return R.fail("未找到配置信息!无法重试,请使用链接重新搬家!"); + return CommonTool.failResult("未找到配置信息!无法重试,请使用链接重新搬家!"); } MoveShopSetting shopMoveCondition = moveShopSettingService.getDetailByShopId(shopId); @@ -137,7 +140,7 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi moveProductPublishBuffer.setPriority(priority); moveProductPublishBufferService.insertSelective(moveProductPublishBuffer); - return R.ok(); + return CommonTool.successResult(); } public int getTaskPriority(long shopId) { diff --git a/ms-biz/src/main/java/com/ms/api/spi/move/SearchDSProductCatTreeService.java b/ms-biz/src/main/java/com/ms/api/spi/move/SearchDSProductCatTreeService.java index 1b99b935..0f86e633 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/move/SearchDSProductCatTreeService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/move/SearchDSProductCatTreeService.java @@ -57,7 +57,6 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext Ret getTosContentRet = storageService.getContent(tosPath); if (getTosContentRet.getResult().equals("success")) { arrayData = JSONObject.parseArray(getTosContentRet.getData().get("data").toString()); - log.info(arrayData.toString() + "111111"); } else { try { res = dsJsonRequestTemplate.execute("/move/search_ds_product_cat_tree", params);