|
|
|
@ -35,6 +35,18 @@ import com.ms.api.service.*;
|
|
|
|
|
import com.ms.api.tool.*;
|
|
|
|
|
import com.ms.api.util.DdRequestUtil;
|
|
|
|
|
import com.ms.dal.entity.*;
|
|
|
|
|
import com.ms.dal.entity.Category;
|
|
|
|
|
import com.ms.dal.entity.CategoryShop;
|
|
|
|
|
import com.ms.dal.entity.MaterialAuditStatusBuffer;
|
|
|
|
|
import com.ms.dal.entity.MaterialBizAuditStatusLog;
|
|
|
|
|
import com.ms.dal.entity.MaterialBizQueue;
|
|
|
|
|
import com.ms.dal.entity.MaterialBizToMaterial;
|
|
|
|
|
import com.ms.dal.entity.MoveCollectTaskDetail;
|
|
|
|
|
import com.ms.dal.entity.MoveProductPublishQueue;
|
|
|
|
|
import com.ms.dal.entity.MoveProductPublishToPicQueue;
|
|
|
|
|
import com.ms.dal.entity.RsyncCategoryQueue;
|
|
|
|
|
import com.ms.dal.entity.Shop;
|
|
|
|
|
import com.ms.dal.entity.Shop1688DsAuth;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -2049,23 +2061,21 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
|
|
|
|
|
|
|
|
|
|
private Ret checkTaskDetailCidIsValid(MoveProductPublishQueueBO queueMsg, long shopId) {
|
|
|
|
|
// TODO 检查店铺的Cid,假设是成功了
|
|
|
|
|
// if ($queueMsg['cnali_ds_detail_id']) {
|
|
|
|
|
// return CommonTool::successResult();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// $cid = $queueMsg['cid'];
|
|
|
|
|
// $ret = $this->shopService->checkTaskDetailCidIsValidByCategoryShop($cid, $shopId);
|
|
|
|
|
// if (CommonTool::isSuccessRet($ret)) {
|
|
|
|
|
// return CommonTool::successResult();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// $cateListAll = $this->rsyncProductService->getAllShopCategorys($shopId);
|
|
|
|
|
// $categoryIds = ZcArrayHelper::getSub($cateListAll, 'category_id');
|
|
|
|
|
// if(!in_array($cid, $categoryIds)) {
|
|
|
|
|
// $this->productPublishLog->info("checkTaskDetailCidIsValid fail cid:" . $cid . ",categoryIds:" . var_export($categoryIds, 1));
|
|
|
|
|
// return CommonTool::failResult('店铺分类不存在');
|
|
|
|
|
// }
|
|
|
|
|
// return CommonTool::successResult();
|
|
|
|
|
if (ObjectUtil.isNotNull(queueMsg.getCnaliDsDetailId())) {
|
|
|
|
|
return Ret.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String cid = queueMsg.getCid();
|
|
|
|
|
CategoryShop ret = categoryShopService.selectByPrimaryKey(shopId, Long.valueOf(cid));
|
|
|
|
|
if (ObjectUtil.isNotNull(ret)) {
|
|
|
|
|
return Ret.success();
|
|
|
|
|
}
|
|
|
|
|
Map<Long, Category> allShopCategorys = getAllLeafProductCatListFromDb(shopId);
|
|
|
|
|
Set<Long> categoryIds = allShopCategorys.keySet();
|
|
|
|
|
if (!categoryIds.contains(cid)) {
|
|
|
|
|
log.info("checkTaskDetailCidIsValid fail cid:" + cid + ",categoryIds:{}", JSON.toJSONString(categoryIds));
|
|
|
|
|
return Ret.fail("店铺分类不存在");
|
|
|
|
|
}
|
|
|
|
|
return Ret.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2252,40 +2262,41 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
|
|
|
|
|
private Ret checkMoveDataCompletion(MoveProductPublishQueueBO taskDetail, JSONObject sourceProductData) {
|
|
|
|
|
// TODO 检查数据完整性 先都成功
|
|
|
|
|
|
|
|
|
|
// if (empty($taskDetail['condition'])) {
|
|
|
|
|
// return CommonTool::failResult("配置信息丢失,请联系客服");
|
|
|
|
|
// }
|
|
|
|
|
// if(empty($sourceProductData['title'])){
|
|
|
|
|
// return CommonTool::failResult("商品标题必填,检查源商品是否下架");
|
|
|
|
|
// }
|
|
|
|
|
// if(empty($taskDetail['cid'])){
|
|
|
|
|
// return CommonTool::failResult("类目ID必填~~");
|
|
|
|
|
// }
|
|
|
|
|
// if($taskDetail['has_save_notes']) {
|
|
|
|
|
// if(empty($taskDetail['notes'])) {
|
|
|
|
|
// return CommonTool::failResult("商品描述必填~~");
|
|
|
|
|
// }
|
|
|
|
|
// } elseif(empty($sourceProductData['notes']) && $taskDetail['condition']['desc']['descCopyType'] == MoveConst::descCopyTypeCopy){
|
|
|
|
|
// return CommonTool::failResult("商品描述必填~~");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(empty($sourceProductData['price'])){
|
|
|
|
|
// return CommonTool::failResult("获取价格为空,请重试或联系客服~~");
|
|
|
|
|
// }
|
|
|
|
|
// if(empty($sourceProductData['image_paths'])){
|
|
|
|
|
// return CommonTool::failResult("图片信息必填~~");
|
|
|
|
|
// }
|
|
|
|
|
// if ($taskDetail['is_fast_mode']) {
|
|
|
|
|
// return CommonTool::successResult();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (empty($taskDetail['price'])) {
|
|
|
|
|
// return CommonTool::failResult("搬家价格不完整,请联系客服");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (empty($taskDetail['skus']['skuMap']) && !empty($sourceProductData['skuMap'])) {
|
|
|
|
|
// return CommonTool::failResult("搬家SKU不完整,请复制来源链接重新复制商品");
|
|
|
|
|
// }
|
|
|
|
|
if (ObjectUtil.isNull(taskDetail.getCondition())) {
|
|
|
|
|
return CommonTool.failResult("配置信息丢失,请联系客服");
|
|
|
|
|
}
|
|
|
|
|
if (sourceProductData.getString("title") == null || sourceProductData.getString("title").isEmpty()) {
|
|
|
|
|
return CommonTool.failResult("商品标题必填,检查源商品是否下架");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isBlank(taskDetail.getCid())) {
|
|
|
|
|
return CommonTool.failResult("类目ID必填~~");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotNull(taskDetail.getHasSaveNotes()) && taskDetail.getHasSaveNotes()) {
|
|
|
|
|
if (StrUtil.isBlank(taskDetail.getNotes())) {
|
|
|
|
|
return CommonTool.failResult("商品描述必填~~");
|
|
|
|
|
}
|
|
|
|
|
} else if (sourceProductData.getString("notes") == null || sourceProductData.getString("notes").isEmpty() &&
|
|
|
|
|
taskDetail.getCondition().getDesc().getString("descCopyType").equals(MoveConst.descCopyTypeCopy)) {
|
|
|
|
|
return CommonTool.failResult("商品描述必填~~");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sourceProductData.getBigDecimal("price") == null) {
|
|
|
|
|
return CommonTool.failResult("获取价格为空,请重试或联系客服~~");
|
|
|
|
|
}
|
|
|
|
|
if (sourceProductData.getJSONArray("image_paths") == null || sourceProductData.getJSONArray("image_paths").isEmpty()) {
|
|
|
|
|
return CommonTool.failResult("图片信息必填~~");
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtil.isNotNull(taskDetail.getIsFastMode()) && taskDetail.getIsFastMode() != 0) {
|
|
|
|
|
return CommonTool.successResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (taskDetail.getPrice() == null) {
|
|
|
|
|
return CommonTool.failResult("搬家价格不完整,请联系客服");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (taskDetail.getSkus().getJSONObject("skuMap").isEmpty() && !sourceProductData.getJSONObject("skuMap").isEmpty()) {
|
|
|
|
|
return CommonTool.failResult("搬家SKU不完整,请复制来源链接重新复制商品");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CommonTool.successResult();
|
|
|
|
|
}
|
|
|
|
|