|
|
@@ -96,10 +96,6 @@ public class GoodsDonController {
|
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
data.setSold(sold + data.getVirtualSold());
|
|
|
- SearchResult<OrderComment> orderComments = beanSearcher.search(OrderComment.class,
|
|
|
- MapUtils.builder().field(OrderComment::getGoodsId, data.getId())
|
|
|
- .orderBy(OrderComment::getId).desc()
|
|
|
- .build());
|
|
|
|
|
|
Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
|
|
|
if (skuList.size() > 0) {
|
|
|
@@ -108,10 +104,6 @@ public class GoodsDonController {
|
|
|
data.setMonths(goodsDonSku.getMonths());
|
|
|
}
|
|
|
});
|
|
|
- if (orderComments != null) {
|
|
|
- List<OrderComment> comments = orderComments.getDataList();
|
|
|
- data.setOrderComments(comments);
|
|
|
- }
|
|
|
OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderStatus).select(OrderDon::getCreatedTime, OrderDon::getPayTime, OrderDon::getId)
|
|
|
@@ -182,6 +174,12 @@ public class GoodsDonController {
|
|
|
data.setMonths(donFrontSkuView.getMonths());
|
|
|
}
|
|
|
});
|
|
|
+ OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
|
|
|
+ .field(OrderCommentFrontView::getGoodsId, data.getId())
|
|
|
+ .orderBy(OrderCommentFrontView::getCommentTime).desc()
|
|
|
+ .orderBy(OrderCommentFrontView::getId).desc()
|
|
|
+ .build());
|
|
|
+ data.setComments(comments);
|
|
|
OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderStatus).select(OrderDon::getCreatedTime, OrderDon::getPayTime, OrderDon::getId)
|
|
|
@@ -284,4 +282,16 @@ public class GoodsDonController {
|
|
|
.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(views);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取评价列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/comments")
|
|
|
+ public Result<SearchResult<OrderCommentFrontView>> getComments() {
|
|
|
+ SearchResult<OrderCommentFrontView> search = beanSearcher.search(OrderCommentFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .orderBy(OrderCommentFrontView::getCommentTime).desc()
|
|
|
+ .orderBy(OrderCommentFrontView::getId).desc()
|
|
|
+ .build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
+ }
|
|
|
}
|