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