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 7b2d638f..f8164e44 100644 --- a/ms-biz/src/main/java/com/ms/api/TestRedisService.java +++ b/ms-biz/src/main/java/com/ms/api/TestRedisService.java @@ -39,7 +39,7 @@ public class TestRedisService extends SPIBaseService implements ExtensionService redisService.pop(RedisKeyConst.MOVE_PRODUCT_PUBLISH_QUEUE); } - for (long i = 85; i < 150; i++) { + for (long i = 115; i < 180; 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 = 30; i < 150; i++) { + for (long i = 115; i < 180; 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/task/ProcessMovePublishToPicTaskService.java b/ms-biz/src/main/java/com/ms/api/task/ProcessMovePublishToPicTaskService.java index 2fea158c..ab79e60d 100644 --- a/ms-biz/src/main/java/com/ms/api/task/ProcessMovePublishToPicTaskService.java +++ b/ms-biz/src/main/java/com/ms/api/task/ProcessMovePublishToPicTaskService.java @@ -749,11 +749,11 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService { Matcher matcher = pattern.matcher(reason); if (matcher.find()) { String propertyId = matcher.group(1); - Map> productFormatNew = (Map>) productDetailBase.get("productFormatNew"); + JSONObject productFormatNew = (JSONObject)productDetailBase.get("productFormatNew"); if (productFormatNew.containsKey(Long.parseLong(propertyId))) { - List propertyList = (List) productFormatNew.get(Long.parseLong(propertyId)); + JSONArray propertyList = (JSONArray) productFormatNew.get(Long.parseLong(propertyId)); if (!propertyList.isEmpty()) { - StrObjMap property = propertyList.get(0); + JSONObject property = (JSONObject)propertyList.get(0); property.put("diy_type", 1); } } @@ -1348,22 +1348,8 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService { } Object productFormatNew = productData.get("productFormatNew"); - String formatJson = JSON.toJSONString(productFormatNew); - log.info(formatJson); - JSONObject formatObj = JSON.parseObject(formatJson); - List removeKeys = new ArrayList<>(); - for (String key : formatObj.keySet()) { - Object value = formatObj.get(key); - java.util.List list = (java.util.List) value; - if (list.isEmpty()) { - removeKeys.add(key); - } - } - removeKeys.forEach(formatObj::remove); - log.info("转换后" + formatObj.toJSONString()); if (!Objects.isNull(productFormatNew)) { - param.setProductFormatNew(formatObj.toJSONString()); -// param.setProductFormatNew("{\"631\":[{\"diy_type\":1,\"name\":\"嘻哈风\",\"value\":196227}],\"1467\":[{\"diy_type\":0,\"name\":\"59%-69%(含)\",\"value\":168368}],\"1551\":[{\"diy_type\":1,\"name\":\"超短裙\",\"value\":22064}],\"1687\":[{\"diy_type\":0,\"name\":\"改为具体的品牌,没有可以为空\",\"value\":0}],\"1878\":[{\"diy_type\":1,\"name\":\"高腰\",\"value\":16521}],\"2592\":[{\"diy_type\":1,\"name\":\"甜美\",\"value\":23925}],\"785\":[{\"diy_type\":0,\"name\":\"涤纶\",\"value\":25708}],\"813\":[{\"diy_type\":1,\"name\":\"X型\",\"value\":8017}],\"981\":[{\"diy_type\":1,\"name\":\"蛋糕裙\",\"value\":22253}]}"); + param.setProductFormatNew(JSON.toJSONString(productFormatNew)); } Long deliveryDelayDay = productData.getLong("deliveryDelayDay"); 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 b4ae2ad5..fb06c3bc 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 @@ -950,7 +950,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService { TreeMap matchVids = new TreeMap<>(Collections.reverseOrder()); Map matchSourceAttrs = new HashMap<>(); double maxPercent = -1; - String maxMatchAttrValue = attribute.getOptions().get(0).getValue(); + String maxMatchAttrValue = ObjectUtil.isNotEmpty(attribute.getOptions())? attribute.getOptions().get(0).getValue():""; StrObjMap sourceValueMap = searchSourceValue(sourceAttrs, attribute.getPropertyName()); String sourceValue = (String) sourceValueMap.get("sourceValue");