|
|
@@ -6,6 +6,7 @@ import com.cyksj.common.annotation.NoSubmit;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.manage.coupon.CouponDistributePopularizeMapper;
|
|
|
+import com.cyksj.model.entity.GoodsDon;
|
|
|
import com.cyksj.model.entity.User;
|
|
|
import com.cyksj.model.entity.UserDistributePopularize;
|
|
|
import com.cyksj.model.views.UserDistributePopularizeView;
|
|
|
@@ -14,6 +15,7 @@ import com.cyksj.service.user.UserService;
|
|
|
import com.cyksj.web.util.StpCpsManageUser;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
/*
|
|
|
@@ -118,4 +121,28 @@ public class CpsPopularizeController {
|
|
|
cpsPopularizeService.deleteById(cpsUserId, id);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有平台列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/all/goods")
|
|
|
+ public Result<List<GoodsDon>> getAllGoodsList(Boolean isNoBuyout) {
|
|
|
+ MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
+ //过滤买断制 平台
|
|
|
+ String conditionSql;
|
|
|
+ if (isNoBuyout != null && isNoBuyout) {
|
|
|
+ mapBuilder.field(GoodsDon::getSpecialType).op(Operator.IsNull);
|
|
|
+ conditionSql = "(select count(*) from goods_don_sku sku where sku.goods_id = g.id and sku.months = 300) = 0";
|
|
|
+ } 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)";
|
|
|
+ List<GoodsDon> goodsDons = beanSearcher.searchAll(GoodsDon.class, mapBuilder
|
|
|
+ .put("condition", conditionSql)
|
|
|
+ .field(GoodsDon::getType, 1)
|
|
|
+ .field(GoodsDon::getStatus, 1)
|
|
|
+ .field(GoodsDon::getDeleted, true)
|
|
|
+ .onlySelect(GoodsDon::getId, GoodsDon::getCategory, GoodsDon::getType, GoodsDon::getTitle, GoodsDon::getSecondType).build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
|
|
|
+ }
|
|
|
}
|