Bläddra i källkod

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

JiangChongBo 2 år sedan
förälder
incheckning
8a96666c8d

+ 2 - 2
src/main/java/com/caimei/controller/wechat/WxAuthApi.java

@@ -376,7 +376,7 @@ public class WxAuthApi {
      */
     @GetMapping("/get/published/video/list")
     public ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(@CurrentUser SysUser sysUser,Integer status,String clubUserName,Integer cursor,Integer count,@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-                                                                      @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
+                                                                      @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,Integer authUserId){
 //        if (null == sysUser) {
 //            return ResponseJson.error("用户信息异常", null);
 //        }
@@ -392,7 +392,7 @@ public class WxAuthApi {
         if(cursor==null){
             cursor=0;
         }
-        return  authService.getPublishedVideoList(clubUserName,status,cursor,count,pageNum,pageSize);
+        return  authService.getPublishedVideoList(clubUserName,status,cursor,count,pageNum,pageSize,authUserId);
     }
 
     /**

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

@@ -134,9 +134,9 @@ public interface AuthMapper {
 
     Integer checkActivityTime(@Param("releaseTime") String releaseTime);
 
-    List<ChallengeRoundVo> getPublishedVideoList(@Param("clubUserName")String clubUserName,@Param("status")Integer status);
+    List<ChallengeRoundVo> getPublishedVideoList(@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);
+    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> getAuthPartylist(@Param("authUserId")Integer authUserId);
 

+ 1 - 1
src/main/java/com/caimei/service/auth/AuthService.java

@@ -189,7 +189,7 @@ public interface AuthService {
      * @param count
      * @return
      */
-    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName,Integer status,Integer cursor,Integer count,Integer pageNum,Integer pageSize);
+    ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName,Integer status,Integer cursor,Integer count,Integer pageNum,Integer pageSize,Integer authUserId);
 
     /**
      * 获取已发布视频(后端)

+ 5 - 3
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -1214,9 +1214,10 @@ public class AuthServiceImpl implements AuthService {
      * @return
      */
     @Override
-   public ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName,Integer status,Integer cursor,Integer count,Integer pageNum,Integer pageSize){
+   public ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideoList(String clubUserName,Integer status,Integer cursor,Integer count,Integer pageNum,Integer pageSize,Integer authUserId){
         PageHelper.startPage(pageNum, pageSize);
-        List<ChallengeRoundVo> listChallengeRoundVo=authMapper.getPublishedVideoList(clubUserName,status);
+        ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
+        List<ChallengeRoundVo> listChallengeRoundVo=authMapper.getPublishedVideoList(clubUserName,status,authUserId,activityTime.getStartTime(),activityTime.getEndTime());
         PageInfo<ChallengeRoundVo> pageData = new PageInfo<>(listChallengeRoundVo);
         //调用抖音api获取视频数据
         String dyopenId=null;
@@ -1286,7 +1287,8 @@ public class AuthServiceImpl implements AuthService {
     @Override
     public ResponseJson<PageInfo<ChallengeRoundVo>> getPublishedVideo(String mobile,String authParty,Integer status,Integer cursor,Integer count,Integer authUserId,Integer pageNum,Integer pageSize){
         PageHelper.startPage(pageNum, pageSize);
-        List<ChallengeRoundVo> listChallengeRoundVo=authMapper.getPublishedVideo(mobile,authParty,status,authUserId);
+        ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
+        List<ChallengeRoundVo> listChallengeRoundVo=authMapper.getPublishedVideo(mobile,authParty,status,authUserId,activityTime.getStartTime(),activityTime.getEndTime());
         PageInfo<ChallengeRoundVo> pageData = new PageInfo<>(listChallengeRoundVo);
         //调用抖音api获取视频数据
         String dyopenId=null;

+ 9 - 5
src/main/resources/mapper/AuthMapper.xml

@@ -658,19 +658,23 @@
     </select>
     <select id="getPublishedVideoList" 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
-               where 1=1
+        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=#{clubUserName})
         </if>
+       and  cr.releaseTime &gt;#{startTime} and  cr.releaseTime&lt;#{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 left join cm_brand_auth cba
-        on cr.authId=cba.id
+        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 &gt;#{startTime} and  cr.releaseTime&lt;#{endTime}
         <if test="mobile != null and mobile != ''">
             and cr.userName like concat('%', #{mobile})
         </if>