ソースを参照

1.7.5认证通版本查询视频功能优化

JiangChongBo 2 年 前
コミット
4e06f21c7d

+ 4 - 0
src/main/java/com/caimei/mapper/cmMapper/AuthMapper.java

@@ -136,8 +136,12 @@ public interface AuthMapper {
 
     List<ChallengeRoundVo> getPublishedVideoList(@Param("clubUserName")String clubUserName,@Param("status")Integer status,Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
 
+    List<ChallengeRoundVo> getPublishedVideoListNoRanking(@Param("clubUserName")String clubUserName,@Param("status")Integer status,Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+
     List<ChallengeRoundVo> getPublishedVideo(@Param("mobile")String mobile,@Param("authParty")String authParty,@Param("status")Integer status,@Param("authUserId")Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
 
+    List<ChallengeRoundVo> getPublishedVideoNoRanking(@Param("mobile")String mobile,@Param("authParty")String authParty,@Param("status")Integer status,@Param("authUserId")Integer authUserId,@Param("startTime")String startTime,@Param("endTime")String endTime);
+
     List<ChallengeRoundVo> getAuthPartylist(@Param("authUserId")Integer authUserId);
 
     List<ChallengeActivityVo> checkActivityId();

+ 5 - 0
src/main/java/com/caimei/model/vo/ChallengeRoundVo.java

@@ -73,4 +73,9 @@ public class ChallengeRoundVo {
          * 0: 活动未开始 1:活动进行中 2:活动已结束
          */
         private Integer activityState;
+        /**
+         * 0: 活动未开始 0:不参与排名  1:参与排名
+         */
+        private Integer rankingStatus;
+
 }

+ 25 - 0
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -1270,6 +1270,18 @@ public class AuthServiceImpl implements AuthService {
         //根据点赞量降序排序
 //        PageHelper.startPage(pageNum, pageSize);
         List<ChallengeRoundVo> collect = listChallengeRoundVo.stream().sorted(Comparator.comparing(ChallengeRoundVo::getDiggCount).reversed().thenComparing(ChallengeRoundVo::getPlayCount, Comparator.reverseOrder())).collect(Collectors.toList());//先以属性一升序,升序结果进行属性一降序,再进行属性二降序
+        //获取排名数据
+        for (ChallengeRoundVo chall:collect) {
+            chall.setRankingStatus(1);
+        }
+        List<ChallengeRoundVo> publishedVideoListNoRanking = authMapper.getPublishedVideoListNoRanking(clubUserName, status, authUserId, activityTime.getStartTime(), activityTime.getEndTime());
+       //获取不排名的数据
+        if(publishedVideoListNoRanking.size()>0){
+           for (ChallengeRoundVo noRanking:publishedVideoListNoRanking) {
+               noRanking.setRankingStatus(0);
+               collect.add(noRanking);
+           }
+       }
         PageInfo<ChallengeRoundVo> pageDa = new PageInfo<>(collect);
         return ResponseJson.success(pageDa);
     }
@@ -1341,7 +1353,20 @@ public class AuthServiceImpl implements AuthService {
         //根据点赞量降序排序
 //        PageHelper.startPage(pageNum, pageSize);
         List<ChallengeRoundVo> collect = listChallengeRoundVo.stream().sorted(Comparator.comparing(ChallengeRoundVo::getDiggCount).reversed().thenComparing(ChallengeRoundVo::getPlayCount, Comparator.reverseOrder())).collect(Collectors.toList());//先以属性一升序,升序结果进行属性一降序,再进行属性二降序
+        //获取排名数据
+        for (ChallengeRoundVo chall:collect) {
+            chall.setRankingStatus(1);
+        }
         PageInfo<ChallengeRoundVo> pageDa = new PageInfo<>(collect);
+        //获取不排名的数据
+        List<ChallengeRoundVo> publishedVideoListNoRanking = authMapper.getPublishedVideoNoRanking(mobile,authParty,status,authUserId,activityTime.getStartTime(),activityTime.getEndTime());
+        //获取不排名的数据
+        if(publishedVideoListNoRanking.size()>0){
+            for (ChallengeRoundVo noRanking:publishedVideoListNoRanking) {
+                noRanking.setRankingStatus(0);
+                collect.add(noRanking);
+            }
+        }
         return ResponseJson.success(pageDa);
     }
 

+ 29 - 0
src/main/resources/mapper/AuthMapper.xml

@@ -668,6 +668,18 @@
         </if>
        and  cr.releaseTime &gt;#{startTime} and  cr.releaseTime&lt;#{endTime}
     </select>
+    <select id="getPublishedVideoListNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
+        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand
+        from cm_challenge_round cr
+        left join cm_brand_auth cba on cr.authId=cba.id
+        left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
+        where cr.authUserId=#{authUserId}
+        <if test="clubUserName != null and clubUserName != ''">
+            and (cr.userName like concat('%', #{clubUserName})
+            or  cba.authParty like concat('%', #{clubUserName},'%') )
+        </if>
+        and  (cr.releaseTime &lt;#{startTime} or  cr.releaseTime &gt;#{endTime})
+    </select>
     <select id="getPublishedVideo" resultType="com.caimei.model.vo.ChallengeRoundVo">
         select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand
         from cm_challenge_round cr
@@ -685,6 +697,23 @@
             and cr.status = #{status}
         </if>
     </select>
+    <select id="getPublishedVideoNoRanking" resultType="com.caimei.model.vo.ChallengeRoundVo">
+        select cr.id,cr.userName,cr.itemId,cr.title,cr.ossName,cr.ossUrl,cr.cover,cr.releaseTime,cr.status,cr.shareId,cr.authId,cba.authParty,cr.dyCommand
+        from cm_challenge_round cr
+        left join cm_brand_auth cba on cr.authId=cba.id
+        left join cm_challenge_activity cca on cca.authUserId=cr.authUserId
+        where cr.authUserId=#{authUserId}
+        and  (cr.releaseTime &lt;#{startTime} or  cr.releaseTime &gt;#{endTime})
+        <if test="mobile != null and mobile != ''">
+            and cr.userName like concat('%', #{mobile})
+        </if>
+        <if test="authParty != null and authParty != ''">
+            and  cba.authParty like concat('%', #{authParty},'%')
+        </if>
+        <if test="status != null">
+            and cr.status = #{status}
+        </if>
+    </select>
     <select id="checkActivityId" resultType="com.caimei.model.vo.ChallengeActivityVo">
         select id,authUserId
         from cm_challenge_activity