Commit 149014e8 authored by shiyu's avatar shiyu

商品列表

parent 702c981f
...@@ -376,7 +376,7 @@ ...@@ -376,7 +376,7 @@
(SELECT item_id, MAX(price) as max_amount (SELECT item_id, MAX(price) as max_amount
FROM distributor_share_record where `distributor_id` = #{distributorId} AND `type` = #{type} AND enabled =1 FROM distributor_share_record where `distributor_id` = #{distributorId} AND `type` = #{type} AND enabled =1
GROUP BY item_id) t GROUP BY item_id) t
ON d.item_id = t.item_id AND price = t.max_amount where d.distributor_id = #{distributorId} AND d.type = #{type}; ON d.item_id = t.item_id AND price = t.max_amount where d.distributor_id = #{distributorId} AND d.type = #{type} AND d.enabled =1;
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -269,6 +269,9 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -269,6 +269,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
Map<Long, DistributorShareRecord> map = distributorShareRecordList.stream().collect(Collectors.toMap(DistributorShareRecord::getItemId, Function.identity(), (k1, k2) -> k1)); Map<Long, DistributorShareRecord> map = distributorShareRecordList.stream().collect(Collectors.toMap(DistributorShareRecord::getItemId, Function.identity(), (k1, k2) -> k1));
logger.info(">>>>>>> map >>>>> : {}", JsonUtils.from(map)); logger.info(">>>>>>> map >>>>> : {}", JsonUtils.from(map));
List<Long> itemIds = distributorShareRecordList.stream().map(DistributorShareRecord::getItemId).collect(Collectors.toList()); List<Long> itemIds = distributorShareRecordList.stream().map(DistributorShareRecord::getItemId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(itemIds)) {
return Result.success(new PageSearchResult<>());
}
SupplierItemRequestDto searchDto = new SupplierItemRequestDto(); SupplierItemRequestDto searchDto = new SupplierItemRequestDto();
searchDto.setIsOnSale(true); searchDto.setIsOnSale(true);
searchDto.setIsDeleted(false); searchDto.setIsDeleted(false);
...@@ -300,7 +303,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -300,7 +303,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}); });
return Result.success(PageSearchResult.of(pageInfo, supplierItemVos)); return Result.success(PageSearchResult.of(pageInfo, supplierItemVos));
} catch (Exception e) { } catch (Exception e) {
logger.error("查询最近订单所属分销商的商品列表 error : {}", e); logger.error("查询最近订单所属分销商的商品列表,商品类型为:{}, error : {}", dto.getType(), e);
} }
return Result.failed(); return Result.failed();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment