Explorar o código

fix 小店店铺推荐商品列表

zoujiajian hai 1 ano
pai
achega
7bf8a45011

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java

@@ -54,7 +54,7 @@ public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
 
 	List<Long> getTicketGoodsId(@Param("list") List<Long> userIds, @Param("status") List<String> status);
 
-	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(@Param("page") Page<UserRecommendGoodsFrontView> page, @Param("list") List<Long> filter_goods_id, @Param("isPayNf") Boolean isPayNf, @Param("filterCourseGoods") Boolean filterCourseGoods);
+	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(@Param("page") Page<UserRecommendGoodsFrontView> page, @Param("list") List<Long> filter_goods_id, @Param("isPayNf") Boolean isPayNf, @Param("filterCourseGoods") Boolean filterCourseGoods, @Param("yhShopGoodsIds") List<Long> yhShopGoodsIds);
 
 	Long getOutSideGroupsTripsRelationByGoodsId(@Param("skuId") Long skuId, @Param("beginOfDay") DateTime beginOfDay, @Param("extraNum") Integer extraNum, @Param("userId") Long userId, @Param("skuNum") Integer skuNum, @Param("maxNum") Integer maxNum);
 

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopMapper.java

@@ -32,4 +32,6 @@ public interface YhShopMapper extends BaseMapper<YhShop> {
 	YhShopDistributeMoneyApply selectRelationBusiness(Long userId);
 
 	List<YhShopSkuDownInfo> getYhShopSkuSysStatusDownInfo(long userId);
+
+	List<Long> getGoodsIdsByShop(Long yhsId);
 }

+ 6 - 0
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -246,6 +246,12 @@
         <if test="filterCourseGoods!=null and filterCourseGoods">
             and (special_type is null or special_type != 'courseware')
         </if>
+        <if test="yhShopGoodsIds!=null and yhShopGoodsIds.size()>0">
+            and id in
+            <foreach collection="yhShopGoodsIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         ) s order by s.sorted desc,sort_by asc
     </select>
 

+ 4 - 0
netflix-dao/src/main/resources/mapper/YhShopMapper.xml

@@ -72,4 +72,8 @@
                  inner join goods_don g on g.id = s.goods_id
         group by g.id
     </select>
+
+    <select id="getGoodsIdsByShop" resultType="java.lang.Long">
+        select distinct goods_id from yh_shop_goods_sku where yhs_id = #{yhsId}
+    </select>
 </mapper>

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java

@@ -29,7 +29,7 @@ public interface GroupRelationFrontService {
 
 	GroupsRelation getSimilarExpiredGroupRelation(GoodsDonSku sku, List<Long> errorsRelationIds, String ip);
 
-	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(Boolean isPayNf, List<Long> filter_goods_id, Boolean filterCourseGoods, Integer start, Integer limit);
+	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(List<Long> yhShopGoodsIds, Boolean isPayNf, List<Long> filter_goods_id, Boolean filterCourseGoods, Integer start, Integer limit);
 
 	/**
 	 * 通过邮件发送课程

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -514,8 +514,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	}
 
 	@Override
-	public Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(Boolean isPayNf, List<Long> filter_goods_id, Boolean filterCourseGoods, Integer start, Integer limit) {
-		return groupsRelationMapper.getRecommendGoodsViews(new Page<>(start, limit), filter_goods_id, isPayNf, filterCourseGoods);
+	public Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(List<Long> yhShopGoodsIds, Boolean isPayNf, List<Long> filter_goods_id, Boolean filterCourseGoods, Integer start, Integer limit) {
+		return groupsRelationMapper.getRecommendGoodsViews(new Page<>(start, limit), filter_goods_id, isPayNf, filterCourseGoods, yhShopGoodsIds);
 	}
 
 	@Override

+ 15 - 2
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -26,6 +26,7 @@ import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.manage.form.FormFieldsDataMapper;
 import com.cyksj.mapper.manage.form.QuestionnairePromotionMapper;
+import com.cyksj.mapper.shop.YhShopMapper;
 import com.cyksj.model.dto.DoubleVerifyDto;
 import com.cyksj.model.dto.GalaxyCoinPayConfigDto;
 import com.cyksj.model.dto.QuestionnaireView;
@@ -152,6 +153,8 @@ public class GroupRelationController {
 
     private final BackInfoTranslationsFrontService backInfoTranslationsFrontService;
 
+    private final YhShopMapper yhShopMapper;
+
     private final static Sequence SEQUENCE = new Sequence(0);
 
     @RequestMapping("/get/renewal")
@@ -596,7 +599,7 @@ public class GroupRelationController {
      * 推荐平台
      */
     @GetMapping("/get/recommend/goods")
-    public Result<Page<UserRecommendGoodsFrontView>> getRecommendGoodsViews(@RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "5") Integer limit) {
+    public Result<Page<UserRecommendGoodsFrontView>> getRecommendGoodsViews(@RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "5") Integer limit, String customId) {
         //推荐用户未购买的车票平台 优先展示ai类平台 然后是影视流媒体
         long userId = StpUserUtil.getLoginIdAsLong();
         List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
@@ -624,7 +627,17 @@ public class GroupRelationController {
         if (orders > 0) {
             filterCourseGoods = true;
         }
-        Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(isPayNf, filter_goods_id, filterCourseGoods, start, limit);
+        List<Long> yhShopGoodsIds = null;
+        if (StrUtil.isNotBlank(customId)) {
+            YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
+                    .eq(YhShop::getCustomId, customId)
+                    .last("limit 1"));
+            if (yhShop != null) {
+                //获取可用的平台
+                yhShopGoodsIds = yhShopMapper.getGoodsIdsByShop(yhShop.getId());
+            }
+        }
+        Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(yhShopGoodsIds, isPayNf, filter_goods_id, filterCourseGoods, start, limit);
         return GatewayResponse.SUCCESS.newBuilder().toResult(page);
     }