|
|
@ -8,6 +8,7 @@ import com.jinritemai.cloud.base.api.BaseRequest;
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
|
|
|
|
|
|
|
|
import com.ms.api.biz.SaveBatchMoveTaskBizService;
|
|
|
|
import com.ms.api.common.R;
|
|
|
|
import com.ms.api.common.R;
|
|
|
|
import com.ms.api.common.Ret;
|
|
|
|
import com.ms.api.common.Ret;
|
|
|
|
import com.ms.api.common.SPIBaseService;
|
|
|
|
import com.ms.api.common.SPIBaseService;
|
|
|
@ -47,6 +48,8 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi
|
|
|
|
private MoveProductPublishBufferService moveProductPublishBufferService;
|
|
|
|
private MoveProductPublishBufferService moveProductPublishBufferService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private MoveShopSettingService moveShopSettingService;
|
|
|
|
private MoveShopSettingService moveShopSettingService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SaveBatchMoveTaskBizService saveBatchMoveTaskBizService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public BaseResponse<Ret> handle(BaseRequest<FailRetryMoveTasksRequestDTO> req) {
|
|
|
|
public BaseResponse<Ret> handle(BaseRequest<FailRetryMoveTasksRequestDTO> req) {
|
|
|
@ -61,8 +64,8 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi
|
|
|
|
int processCount = 0;
|
|
|
|
int processCount = 0;
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
Long detailId = taskDetailIds.get(i);
|
|
|
|
Long detailId = taskDetailIds.get(i);
|
|
|
|
BaseResponse<Void> rsp = this.retryMoveTask(detailId, shopId, "");
|
|
|
|
Ret retryRet = this.retryMoveTask(detailId, shopId, "");
|
|
|
|
if (Objects.equals(rsp.getCode(), "10000")) {
|
|
|
|
if (retryRet.getResult().equals("success")) {
|
|
|
|
processCount++;
|
|
|
|
processCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -86,10 +89,10 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi
|
|
|
|
return R.fail("操作失败");
|
|
|
|
return R.fail("操作失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private BaseResponse<Void> retryMoveTask(Long detailId, Long shopId, String reason) {
|
|
|
|
private Ret retryMoveTask(Long detailId, Long shopId, String reason) {
|
|
|
|
BaseResponse<Void> checkAndGetConfigIdRet = this.checkAvailableCopyAndGetMoveConfigId(detailId, 1);
|
|
|
|
int needAddCnt = 1;
|
|
|
|
if (!Objects.equals(checkAndGetConfigIdRet.getCode(), "10000")) {
|
|
|
|
Ret checkAndGetConfigIdRet = saveBatchMoveTaskBizService.checkAvailableCopyAndGetMoveConfigId(detailId, needAddCnt);
|
|
|
|
//返回失败则直接返回
|
|
|
|
if (checkAndGetConfigIdRet.getResult().equals("fail")) {
|
|
|
|
return checkAndGetConfigIdRet;
|
|
|
|
return checkAndGetConfigIdRet;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String curMonth = CommonTool.getCurMonthLastTime();
|
|
|
|
String curMonth = CommonTool.getCurMonthLastTime();
|
|
|
@ -97,13 +100,13 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi
|
|
|
|
|
|
|
|
|
|
|
|
MoveCollectTaskDetail moveCollectTaskDetail = moveCollectTaskDetailService.getMoveCollectTaskDetail(shopId, detailId);
|
|
|
|
MoveCollectTaskDetail moveCollectTaskDetail = moveCollectTaskDetailService.getMoveCollectTaskDetail(shopId, detailId);
|
|
|
|
if (moveCollectTaskDetail == null) {
|
|
|
|
if (moveCollectTaskDetail == null) {
|
|
|
|
return R.fail("任务不存在");
|
|
|
|
return CommonTool.failResult("任务不存在");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MoveCollectTask moveCollectTask = moveCollectTaskService.getMoveCollectTask(moveCollectTaskDetail.getMoveCollectTaskId(), shopId);
|
|
|
|
MoveCollectTask moveCollectTask = moveCollectTaskService.getMoveCollectTask(moveCollectTaskDetail.getMoveCollectTaskId(), shopId);
|
|
|
|
String condition=moveCollectTask.getCondition();
|
|
|
|
String condition=moveCollectTask.getCondition();
|
|
|
|
if (BeanUtil.isEmpty(condition)) {
|
|
|
|
if (BeanUtil.isEmpty(condition)) {
|
|
|
|
return R.fail("未找到配置信息!无法重试,请使用链接重新搬家!");
|
|
|
|
return CommonTool.failResult("未找到配置信息!无法重试,请使用链接重新搬家!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MoveShopSetting shopMoveCondition = moveShopSettingService.getDetailByShopId(shopId);
|
|
|
|
MoveShopSetting shopMoveCondition = moveShopSettingService.getDetailByShopId(shopId);
|
|
|
@ -137,7 +140,7 @@ public class FailRetryMoveTasksService extends SPIBaseService implements Extensi
|
|
|
|
moveProductPublishBuffer.setPriority(priority);
|
|
|
|
moveProductPublishBuffer.setPriority(priority);
|
|
|
|
moveProductPublishBufferService.insertSelective(moveProductPublishBuffer);
|
|
|
|
moveProductPublishBufferService.insertSelective(moveProductPublishBuffer);
|
|
|
|
|
|
|
|
|
|
|
|
return R.ok();
|
|
|
|
return CommonTool.successResult();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int getTaskPriority(long shopId) {
|
|
|
|
public int getTaskPriority(long shopId) {
|
|
|
|