再次搬家

20230922-ljl-fixBug
wangchaoxu 1 year ago
parent 5d84ea78f6
commit 9013bd0b9c

@ -11,12 +11,14 @@ import com.ms.api.biz.SaveBatchMoveTaskBizService;
import com.ms.api.common.R;
import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService;
import com.ms.api.consts.StatusConst;
import com.ms.api.dto.move.MoveAgainDetailRequestDTO;
import com.ms.api.service.MoveCollectTaskDetailService;
import com.ms.api.service.ShopService;
import com.ms.api.tool.CommonTool;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.dal.entity.MoveCollectTaskDetail;
import com.ms.dal.entity.MoveProductPublishBuffer;
import com.ms.dal.entity.Shop;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -54,7 +56,7 @@ public class MoveAgainDetailService extends SPIBaseService implements ExtensionS
int size = taskDetailIds.size();
if (size == 1) {
Long lastDetails = taskDetailIds.get(0);
Integer newDetailId = this.moveAgainDetailsByDetailId(shopId, lastDetails, null);
Long newDetailId = this.moveAgainDetailsByDetailId(shopId, lastDetails, null);
if (newDetailId != null && newDetailId != 0) {
JSONObject retObj = new JSONObject();
retObj.put("processCount", 1);
@ -63,17 +65,15 @@ public class MoveAgainDetailService extends SPIBaseService implements ExtensionS
return R.ok(Ret.fail("当前商品数据已失效,暂不支持操作,如有疑问请联系客服"));
}
} else {
for (int i = 0; i < size; i++) {
}
// todo:
}
// ----结果返回----
return R.fail("111");
}
private Integer moveAgainDetailsByDetailId(Long shopId, Long detailId, Long cnaliDetailId) {
MoveCollectTaskDetail moveCollectTaskDetail = moveCollectTaskDetailService.getMoveCollectTaskDetail(shopId, detailId);
if (moveCollectTaskDetail == null) {
private Long moveAgainDetailsByDetailId(Long shopId, Long detailId, Long cnaliDetailId) {
MoveCollectTaskDetail moveDetail = moveCollectTaskDetailService.getMoveCollectTaskDetail(shopId, detailId);
if (moveDetail == null) {
return null;
}
@ -88,11 +88,49 @@ public class MoveAgainDetailService extends SPIBaseService implements ExtensionS
}
Integer moveShopConfigId = Integer.valueOf(checkAndGetConfigIdRet.getData().get("moveShopConfigId").toString());
// todo checkIsNeedMoveAgainForDsApi相关判断逻辑 用不上,跳过
// todo MoveAgainDetailsForDsApi相关判断逻辑 用不上,跳过
MoveCollectTaskDetail taskDetailData = new MoveCollectTaskDetail();
taskDetailData.setShopId(shopId);
taskDetailData.setMoveCollectTaskId(moveDetail.getMoveCollectTaskId());
taskDetailData.setIsFastMode(moveDetail.getIsFastMode());
taskDetailData.setMoveShopConfigId(moveShopConfigId);
taskDetailData.setSource(moveDetail.getSource());
taskDetailData.setSite(moveDetail.getSource());
taskDetailData.setSourceItemId(moveDetail.getSourceItemId());
taskDetailData.setSourceTitle(moveDetail.getSourceTitle());
taskDetailData.setSourceImgUrl(moveDetail.getSourceImgUrl());
taskDetailData.setSourceShopName(moveDetail.getSourceShopName());
taskDetailData.setCid(moveDetail.getCid());
taskDetailData.setStatus(StatusConst.processing);
taskDetailData.setGmtCreate(new Date());
taskDetailData.setGmtModified(new Date());
// todo: 构建 MoveCollectTaskDetailExt这个版本不用
Integer priority = saveBatchMoveTaskBizService.getTaskPriority(shopId, 1);
MoveProductPublishBuffer insertPublishBuffer = new MoveProductPublishBuffer();
insertPublishBuffer.setShopId(shopId);
insertPublishBuffer.setMoveCollectTaskId(moveDetail.getMoveCollectTaskId().intValue());
insertPublishBuffer.setTryTimes(0);
insertPublishBuffer.setPriority(priority);
insertPublishBuffer.setGmtCreate(new Date());
insertPublishBuffer.setGmtModified(new Date());
boolean addRet = addMoveTaskDetail(shopId, taskDetailData, insertPublishBuffer, moveShopConfigId, detailId);
if (!addRet) {
return null;
}
return detailId;
}
private boolean addMoveTaskDetail(Long shopId, MoveCollectTaskDetail taskDetailData, MoveProductPublishBuffer insertPublishBuffer, Integer moveShopConfigId, Long detailId) {
// todo:
return null;
return true;
}

Loading…
Cancel
Save