检查店铺cid checkTaskDetailCidIsValid

20230922-ljl-fixBug
daixiaogang 1 year ago
parent 8c3dd8b8da
commit be88561d74

@ -74,6 +74,7 @@ import com.ms.api.tool.MoveTool;
import com.ms.api.tool.SecurityTool; import com.ms.api.tool.SecurityTool;
import com.ms.api.util.DdRequestUtil; import com.ms.api.util.DdRequestUtil;
import com.ms.dal.entity.Category; import com.ms.dal.entity.Category;
import com.ms.dal.entity.CategoryShop;
import com.ms.dal.entity.MaterialAuditStatusBuffer; import com.ms.dal.entity.MaterialAuditStatusBuffer;
import com.ms.dal.entity.MaterialBizAuditStatusLog; import com.ms.dal.entity.MaterialBizAuditStatusLog;
import com.ms.dal.entity.MaterialBizQueue; import com.ms.dal.entity.MaterialBizQueue;
@ -918,7 +919,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
productDetailBase.put("updateSkuMinPriceInfo", updateSkuMinPriceInfo); productDetailBase.put("updateSkuMinPriceInfo", updateSkuMinPriceInfo);
// 品牌 // 品牌
Ret matchBrandRet = searchBrandIdByBrandNameFromDd(cid, brandName, accessToken,true); Ret matchBrandRet = searchBrandIdByBrandNameFromDd(cid, brandName, accessToken, true);
if (CommonTool.isFailRet(matchBrandRet)) { if (CommonTool.isFailRet(matchBrandRet)) {
return matchBrandRet; return matchBrandRet;
} }
@ -1321,6 +1322,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
private String getBrandNameFromDdBrand(AuthBrandListItem brand) { private String getBrandNameFromDdBrand(AuthBrandListItem brand) {
return StrUtil.isBlank(brand.getNameCn()) ? brand.getNameEn() : (StrUtil.isBlank(brand.getNameEn()) ? brand.getNameCn() : brand.getNameEn().concat(".").concat(brand.getNameCn())); return StrUtil.isBlank(brand.getNameCn()) ? brand.getNameEn() : (StrUtil.isBlank(brand.getNameEn()) ? brand.getNameCn() : brand.getNameEn().concat(".").concat(brand.getNameCn()));
} }
private String getBrandNameFromDdBrand(BrandListItem brand) { private String getBrandNameFromDdBrand(BrandListItem brand) {
return StrUtil.isBlank(brand.getNameCn()) ? brand.getNameEn() : (StrUtil.isBlank(brand.getNameEn()) ? brand.getNameCn() : brand.getNameEn().concat(".").concat(brand.getNameCn())); return StrUtil.isBlank(brand.getNameCn()) ? brand.getNameEn() : (StrUtil.isBlank(brand.getNameEn()) ? brand.getNameCn() : brand.getNameEn().concat(".").concat(brand.getNameCn()));
} }
@ -1544,23 +1546,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();
} }

Loading…
Cancel
Save