...
|
...
|
@@ -120,9 +120,9 @@ public class CutdownPageSceneService extends AbstractPageSceneService { |
|
|
Map<String, Object> productMap = new HashMap<>();
|
|
|
Integer productSkn = MapUtils.getIntValue(map, ProductIndexEsField.productSkn, 0);
|
|
|
productSknList.add(productSkn);
|
|
|
productMap.put("product_skn", productSkn);
|
|
|
productMap.put("product_name", MapUtils.getString(map, ProductIndexEsField.productName, ""));
|
|
|
productMap.put("default_images", MapUtils.getString(map, ProductIndexEsField.defaultImages, ""));
|
|
|
productMap.put("productSkn", productSkn);
|
|
|
productMap.put("productName", MapUtils.getString(map, ProductIndexEsField.productName, ""));
|
|
|
productMap.put("defaultImages", MapUtils.getString(map, ProductIndexEsField.defaultImages, ""));
|
|
|
productList.add(productMap);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -136,7 +136,7 @@ public class CutdownPageSceneService extends AbstractPageSceneService { |
|
|
Iterator<Map<String, Object>> productIterator = productList.iterator();
|
|
|
while (productIterator.hasNext()) {
|
|
|
Map<String, Object> product = productIterator.next();
|
|
|
Integer productSkn = MapUtils.getIntValue(product, "product_skn", 0);
|
|
|
Integer productSkn = MapUtils.getIntValue(product, "productSkn", 0);
|
|
|
Map<String, Object> cutdownPriceInfo = cutdownPriceMap.get(productSkn);
|
|
|
if (cutdownPriceInfo == null) {
|
|
|
productIterator.remove();
|
...
|
...
|
@@ -167,22 +167,22 @@ public class CutdownPageSceneService extends AbstractPageSceneService { |
|
|
continue;
|
|
|
}
|
|
|
Map<String, Object> returnInfo = new HashMap<>();
|
|
|
returnInfo.put("activity_id", cutdownPriceProduct.getActivityId());
|
|
|
returnInfo.put("high_price", cutdownPriceProduct.getHighPrice());
|
|
|
returnInfo.put("low_price", cutdownPriceProduct.getLowPrice());
|
|
|
returnInfo.put("join_num", cutdownPriceProduct.getJoinNum());
|
|
|
returnInfo.put("product_skn", cutdownPriceProduct.getProductSkn());
|
|
|
returnInfo.put("activity_begin_time", activity.getBeginTime());
|
|
|
returnInfo.put("activity_end_time", activity.getEndTime());
|
|
|
returnInfo.put("activityId", cutdownPriceProduct.getActivityId());
|
|
|
returnInfo.put("highPrice", cutdownPriceProduct.getHighPrice());
|
|
|
returnInfo.put("lowPrice", cutdownPriceProduct.getLowPrice());
|
|
|
returnInfo.put("joinNum", cutdownPriceProduct.getJoinNum());
|
|
|
returnInfo.put("productSkn", cutdownPriceProduct.getProductSkn());
|
|
|
returnInfo.put("beginTime", activity.getBeginTime());
|
|
|
returnInfo.put("endTime", activity.getEndTime());
|
|
|
cutdownPriceReturnList.add(returnInfo);
|
|
|
}
|
|
|
//2、按活动开始时间排序
|
|
|
cutdownPriceReturnList = cutdownPriceReturnList.stream().sorted(Comparator.comparing(a -> MapUtils.getIntValue(a, "activity_begin_time", 0))).collect(Collectors.toList());
|
|
|
cutdownPriceReturnList = cutdownPriceReturnList.stream().sorted(Comparator.comparing(a -> MapUtils.getIntValue(a, "beginTime", 0))).collect(Collectors.toList());
|
|
|
|
|
|
//3、skn去重
|
|
|
Map<Integer, Map<String, Object>> result = new HashMap<>();
|
|
|
for (Map<String, Object> cutdownPrice : cutdownPriceReturnList) {
|
|
|
Integer productSkn = MapUtils.getIntValue(cutdownPrice, "product_skn", 0);
|
|
|
Integer productSkn = MapUtils.getIntValue(cutdownPrice, "productSkn", 0);
|
|
|
if (result.containsKey(productSkn)) {
|
|
|
continue;
|
|
|
}
|
...
|
...
|
|