diff --git a/ms-biz/src/main/java/com/ms/api/TestRedisService.java b/ms-biz/src/main/java/com/ms/api/TestRedisService.java index 87e11cc4..7b2d638f 100644 --- a/ms-biz/src/main/java/com/ms/api/TestRedisService.java +++ b/ms-biz/src/main/java/com/ms/api/TestRedisService.java @@ -35,11 +35,11 @@ public class TestRedisService extends SPIBaseService implements ExtensionService initHandle(req); ItemDTO itemDTO = req.getData(); if(itemDTO.getTitle().equals("initProcess")){ - for (long i = 0; i < 5; i++) { + for (long i = 85; i < 150; i++) { redisService.pop(RedisKeyConst.MOVE_PRODUCT_PUBLISH_QUEUE); } - for (long i = 90; i < 100; i++) { + for (long i = 85; i < 150; i++) { MoveProductPublishQueue data = moveProductPublishQueueService.selectByPrimaryKey(i); if(data != null && data.getLocked() == 0){ redisService.push(RedisKeyConst.MOVE_PRODUCT_PUBLISH_QUEUE, String.valueOf(data.getMoveCollectTaskDetailId())); @@ -53,7 +53,7 @@ public class TestRedisService extends SPIBaseService implements ExtensionService redisService.pop(RedisKeyConst.MOVE_PRODUCT_PUBLISH_TO_PIC_QUEUE); } - for (long i = 98; i < 150; i++) { + for (long i = 30; i < 150; i++) { MoveProductPublishToPicQueue data = moveProductPublishToPicQueueService.selectByPrimaryKey(i); if (data != null && data.getLocked() == 0) { redisService.push(RedisKeyConst.MOVE_PRODUCT_PUBLISH_TO_PIC_QUEUE, String.valueOf(data.getMoveProductPublishToPicQueueId())); diff --git a/ms-biz/src/main/java/com/ms/api/biz/MoveService.java b/ms-biz/src/main/java/com/ms/api/biz/MoveService.java index f96c1412..1d0d4e93 100644 --- a/ms-biz/src/main/java/com/ms/api/biz/MoveService.java +++ b/ms-biz/src/main/java/com/ms/api/biz/MoveService.java @@ -177,7 +177,7 @@ public class MoveService { productDetailBase.put("categoryLeafId", queueMsg.getCid()); // 尺寸模版 - Long size = getSizeTemplateId(shopId, condition, moveBaseData); + Long size = getSizeTemplateId(shopId, Long.parseLong(queueMsg.getCid())); productDetailBase.put("sizeTemplateId", size); // 发货时间 @@ -325,6 +325,9 @@ public class MoveService { ProductGetProductUpdateRuleParam param = new ProductGetProductUpdateRuleParam(); param.setCategoryId(Long.valueOf(cid)); ApiResult productUpdateRuleRet = DdRequestUtil.getBrandListV2FromDdNotEx(param, accessToken); + if(!productUpdateRuleRet.isSuccess()){ + return new HashMap<>(); + } ProductGetProductUpdateRuleData productUpdateRule = productUpdateRuleRet.getData(); if (!productUpdateRule.getAfterSaleRule().getSupplyDayReturnRule().getEnable() || ObjectUtil.isEmpty(productUpdateRule.getAfterSaleRule().getSupplyDayReturnRule().getOptions())) { return new HashMap<>(); @@ -358,8 +361,7 @@ public class MoveService { return title; } - public Long getSizeTemplateId(long shopId, MoveShopSettingBO condition, JSONObject moveBaseData) { - long cid = moveBaseData.getLong("cid"); + public Long getSizeTemplateId(long shopId, long cid) { return getShopSettingSizeTemplateIdByCid(shopId, cid); } diff --git a/ms-biz/src/main/java/com/ms/api/task/ProcessProductPublishTaskService.java b/ms-biz/src/main/java/com/ms/api/task/ProcessProductPublishTaskService.java index 8d8f63e7..a4c79a3a 100644 --- a/ms-biz/src/main/java/com/ms/api/task/ProcessProductPublishTaskService.java +++ b/ms-biz/src/main/java/com/ms/api/task/ProcessProductPublishTaskService.java @@ -2044,7 +2044,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService { public Map buildSkuListAndSkuImages(JSONObject skuMap, JSONObject colorMap, JSONObject sizeMap) { double defaultPrice = getSkuDefaultPrice(skuMap); Map skuList = new HashMap<>(); - if (!colorMap.isEmpty() && !sizeMap.isEmpty()) { + if (ObjectUtil.isNotEmpty(colorMap) && ObjectUtil.isNotEmpty(sizeMap)) { for (String cAv : colorMap.keySet()) { for (String sAv : sizeMap.keySet()) { SkuDetailBO skuDetail = new SkuDetailBO(); @@ -2061,7 +2061,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService { } } } - } else if (!colorMap.isEmpty()) { + } else if (ObjectUtil.isNotEmpty(colorMap)) { for (String cAv : colorMap.keySet()) { SkuDetailBO skuDetail = new SkuDetailBO(); skuDetail.setPrice(buildSkuPrice(skuMap, cAv, "", defaultPrice)); @@ -2076,7 +2076,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService { skuList.put(keyString, skuDetail); } } - } else if (!sizeMap.isEmpty()) { + } else if (ObjectUtil.isNotEmpty(sizeMap)) { for (String sAv : sizeMap.keySet()) { SkuDetailBO skuDetail = new SkuDetailBO(); skuDetail.setPrice(buildSkuPrice(skuMap, "", sAv, defaultPrice)); @@ -2288,8 +2288,8 @@ public class ProcessProductPublishTaskService extends TaskBaseService { boolean checkSize = false; skuPropStr = skuPropStr.trim(); - sAv = sAv.trim(); - if (sAv.isEmpty() && skuPropStr.isEmpty()) { + sAv = StringUtils.isNotBlank(sAv)? sAv.trim():""; + if (ObjectUtil.isNotEmpty(sAv) && ObjectUtil.isNotEmpty(skuPropStr)) { checkSize = true; } else { String[] skuPropArr = skuPropStr.split(";");