|
|
@@ -232,7 +232,7 @@ public class CmsGoodsDonController {
|
|
|
* 获取所有平台以及其规格
|
|
|
*/
|
|
|
@GetMapping("/get/all/goods/sku")
|
|
|
- public Result<List<GoodsDetailView>> getAllGoodsDetail(Boolean isNoBuyout) {
|
|
|
+ public Result<List<GoodsDetailView>> getAllGoodsDetail(Boolean isNoBuyout, Boolean isMirror) {
|
|
|
MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
//过滤买断制 平台
|
|
|
String conditionSql;
|
|
|
@@ -242,7 +242,11 @@ public class CmsGoodsDonController {
|
|
|
} else {
|
|
|
conditionSql = "(special_type is null or special_type != 'giftCard')";
|
|
|
}
|
|
|
- conditionSql += " and exists (select id from goods_don_sku sku where sku.goods_id = g.id limit 1)";
|
|
|
+ String mirrorSql = StrUtil.EMPTY;
|
|
|
+ if (isMirror != null) {
|
|
|
+ mirrorSql += " and is_mirror = " + isMirror;
|
|
|
+ }
|
|
|
+ conditionSql += String.format(" and exists (select id from goods_don_sku sku where sku.goods_id = g.id %s limit 1)", mirrorSql);
|
|
|
|
|
|
List<GoodsDetailView> goodsDons = beanSearcher.searchAll(GoodsDetailView.class, mapBuilder
|
|
|
.put("condition", conditionSql)
|
|
|
@@ -251,10 +255,12 @@ public class CmsGoodsDonController {
|
|
|
.field(GoodsDetailView::getDeleted, true)
|
|
|
.onlySelect(GoodsDetailView::getId, GoodsDetailView::getTitle)
|
|
|
.build());
|
|
|
- goodsDons.forEach(e->{
|
|
|
+ goodsDons.forEach(e -> {
|
|
|
List<GoodsDonSku> donSkus = skuMapper.selectList(Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
.eq(GoodsDonSku::getGoodsId, e.getId())
|
|
|
- .eq(GoodsDonSku::getStatus, 1).select(GoodsDonSku::getId, GoodsDonSku::getSpecVal));
|
|
|
+ .eq(isMirror != null, GoodsDonSku::getIsMirror, isMirror)
|
|
|
+ .eq(GoodsDonSku::getStatus, 1)
|
|
|
+ .select(GoodsDonSku::getId, GoodsDonSku::getSpecVal));
|
|
|
e.setSkuList(donSkus);
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
|