Просмотр исходного кода

fix 推荐平台过滤课件筛选

zoujiajian 2 лет назад
Родитель
Сommit
be495d989d

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

@@ -53,7 +53,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);
+	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(@Param("page") Page<UserRecommendGoodsFrontView> page, @Param("list") List<Long> filter_goods_id, @Param("isPayNf") Boolean isPayNf, @Param("filterCourseGoods") Boolean filterCourseGoods);
 
 	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);
 

+ 11 - 5
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -211,17 +211,23 @@
         when category = 3 then 755
         else 666 end
         ) as sorted
-        from `goods_don` where id not in
-        <foreach collection="list" item="item" open="(" separator="," close=")">
-            #{item}
-        </foreach>
+        from `goods_don` where deleted is true and status is true
+        <if test="list!=null and list.size()>0">
+            and id not in
+            <foreach collection="list" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="isPayNf">
             and type in (1,2)
         </if>
         <if test="!isPayNf">
             and type = 1
         </if>
-        and deleted is true and status is true) s order by s.sorted desc,sort_by asc
+        <if test="filterCourseGoods!=null and filterCourseGoods">
+            and (special_type is null or special_type != 'courseware')
+        </if>
+        ) s order by s.sorted desc,sort_by asc
     </select>
 
     <select id="getOutSideGroupsTripsRelationByGoodsId" resultType="java.lang.Long">

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

@@ -23,7 +23,7 @@ public interface GroupRelationFrontService {
 
 	GroupsRelation getSimilarExpiredGroupRelation(GoodsDonSku sku, List<Long> errorsRelationIds, String ip);
 
-	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(Boolean isPayNf, List<Long> filter_goods_id, Integer start, Integer limit);
+	Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(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

@@ -343,8 +343,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	}
 
 	@Override
-	public Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(Boolean isPayNf, List<Long> filter_goods_id, Integer start, Integer limit) {
-		return groupsRelationMapper.getRecommendGoodsViews(new Page<>(start, limit),filter_goods_id, isPayNf);
+	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);
 	}
 
 	@Override

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -1033,7 +1033,7 @@ public class GoodsDonController {
 				data.setDays(minPriceUserOwnsSku.getDays());
 			}
 			//课件类型 且过滤
-			if (filterCourseGoods.get() && data.getSpecialType() == GoodsDon.SpecialType.courseware) {
+			if (filterCourseGoods.get() && data.getSpecialType() != null && data.getSpecialType() == GoodsDon.SpecialType.courseware) {
 				return false;
 			}
 			//设置特定价格

+ 12 - 1
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -118,6 +118,8 @@ public class GroupRelationController {
 
     private final AccountBlockedReplaceRecordMapper accountBlockedReplaceRecordMapper;
 
+    private final OrderDonMapper orderDonMapper;
+
     private final static Sequence SEQUENCE = new Sequence(0);
 
     @RequestMapping("/get/renewal")
@@ -539,7 +541,16 @@ public class GroupRelationController {
                 isPayNf = true;
             }
         }
-        Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(isPayNf, filter_goods_id, start, limit);
+        Boolean filterCourseGoods = false;
+        //GPT Plus基础2月 课程不展示
+        Integer orders = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
+                .in(OrderDon::getUserId, userIds)
+                .eq(OrderDon::getSkuId, 444)
+                .notIn(OrderDon::getStatus, Constant.noOrderStatus));
+        if (orders > 0) {
+            filterCourseGoods = true;
+        }
+        Page<UserRecommendGoodsFrontView> page = groupRelationFrontService.getRecommendGoodsViews(isPayNf, filter_goods_id, filterCourseGoods, start, limit);
         return GatewayResponse.SUCCESS.newBuilder().toResult(page);
     }