Authored by hugufei

fix bug

... ... @@ -50,9 +50,6 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
if (maxDateId == null) {
return new ArrayList<>();
}
List<Product> product = productMapper.selectPageLists(offset, limit);
if (CollectionUtils.isEmpty(product)) {
return new ArrayList<>();
... ... @@ -62,12 +59,6 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder {
List<BigdataSimilarSkn> bigdataSimilarSknList = maxDateId == null ? new ArrayList<>() : bigdataSimilarSknMapper.selectBySknList(sknList, maxDateId.toString());
Map<Integer, BigdataSimilarSkn> bigdataSimilarSknMap = bigdataSimilarSknList.stream().collect(Collectors.toMap(BigdataSimilarSkn::getProductSkn, self -> self));
//这里skn可能有重复。已经按skn和dateId正序排序了,直接加进map可以取最大值
// List<BigdataSimilarSknImgYoho> bigdataSimilarSknImgYohoList = bigdataSimilarSknImgYohoMapper.selectBySknListOrderBySknDateId(sknList);
// Map<Integer, BigdataSimilarSknImgYoho> bigdataSimilarSknImgYohoMap = new HashMap<>();
// for (BigdataSimilarSknImgYoho bigdataSimilarSknImgYoho : bigdataSimilarSknImgYohoList) {
// bigdataSimilarSknImgYohoMap.put(bigdataSimilarSknImgYoho.getSkn(), bigdataSimilarSknImgYoho);
// }
List<BigdataSimilarSknImgYoho> bigdataSimilarSknImgYohoList = maxYohoDateId == null ? new ArrayList<>() : bigdataSimilarSknImgYohoMapper.selectListBySknAndDateId(sknList, maxYohoDateId.toString());
Map<Integer, BigdataSimilarSknImgYoho> bigdataSimilarSknImgYohoMap = bigdataSimilarSknImgYohoList.stream().collect(Collectors.toMap(BigdataSimilarSknImgYoho::getSkn, self -> self));
... ...