JiangChongBo 2 år sedan
förälder
incheckning
fb03195576

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

@@ -510,8 +510,8 @@ public class WxAuthApi {
      * @return
      */
     @GetMapping("/check/contest/info")
-    public ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile){
-        return authService.checkContestedInfo(mobile);
+    public ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile,Integer authUserId){
+        return authService.checkContestedInfo(mobile,authUserId);
     }
     /**
      * 获取已报名信息列表
@@ -549,8 +549,8 @@ public class WxAuthApi {
      * @return
      */
     @GetMapping("/check/video/username")
-    public ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile){
-        return authService.checkVideoByUsername(mobile);
+    public ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile,Integer authUserId){
+        return authService.checkVideoByUsername(mobile,authUserId);
     }
     /**
      * 点赞与取消点赞

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

@@ -22,6 +22,8 @@ public interface AuthMapper {
     List<AuthVo> getAuthList(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag")  Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus,@Param("authCode") String authCode);
     List<AuthVo> getAuthListAll(@Param("listType") Integer listType, @Param("authUserId") Integer authUserId, @Param("authParty") String authParty, @Param("mobile") String mobile, @Param("status") Integer status, @Param("starFlag")  Integer starFlag, @Param("auditStatus") Integer auditStatus, @Param("lowerAuditStatus") Integer lowerAuditStatus, @Param("shopAuditStatus") Integer shopAuditStatus, @Param("sendStatus") Integer sendStatus,@Param("name") String name,@Param("snCode") String snCode);
 
+    Integer getClubUserIdByAuthId(Integer authId);
+
     void updateAuthStatusByAuthId(@Param("authId") Integer authId, @Param("status") Integer status);
 
     void deleteAuthByAuthId(Integer authId);
@@ -193,14 +195,14 @@ public interface AuthMapper {
 
     List<RossChallengeRoundVo> getcontestedInfo(Integer authUserId);
 
-    RossChallengeRoundVo getcontestedInfoByUserName(@Param("mobile")String mobile);
+    RossChallengeRoundVo getcontestedInfoByUserName(@Param("mobile")String mobile,@Param("startTime")String startTime,@Param("endTime")String endTime);
 
 
     List<RossChallengeVideo> getVideoAll(@Param("mobileOrAuthpart")String mobileOrAuthpart,Integer authUserId);
 
     List<RossChallengeVideo> getVideoByUsername(@Param("mobile")String mobile);
 
-    List<RossChallengeVideo> checkVideoByUsername(@Param("mobile")String mobile);
+    List<RossChallengeVideo> checkVideoByUsername(@Param("mobile")String mobile,@Param("startTime")String startTime,@Param("endTime")String endTime);
 
     void upVideoDiggCount(Integer videoId,Integer diggFlag,@Param("clubUserIds")String clubUserIds);
 

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

@@ -162,5 +162,10 @@ public class AuthVo {
      * 认证编号
      */
     private String authCode;
+    /**
+     * 用户id
+     */
+    private Integer clubUserId;
+
 
 }

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

@@ -319,7 +319,7 @@ public interface AuthService {
      * @param mobile
      * @return
      */
-    ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile);
+    ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile,Integer authUserId);
     /**
      * 获取已报名信息列表
      * @return
@@ -343,7 +343,7 @@ public interface AuthService {
      * @param mobile 登录账号
      * @return
      */
-    ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile);
+    ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile,Integer authUserId);
 
     /**
      * 点赞与取消点赞

+ 27 - 8
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -534,6 +534,11 @@ public class AuthServiceImpl implements AuthService {
         } else {
             // 审核通过,上线授权
             status = 1;
+            //更新authid到V1.7.7ross挑战赛机构信息表
+            //获取clubruserid
+            Integer clubUserId = authMapper.getClubUserIdByAuthId(authId);
+            //1.7.7ross挑战赛新加逻辑:更新机构信息到挑战赛表
+            clubMapper.upAuthByid(clubUserId,authId);
         }
         if (1 == source) {
             authMapper.updateAuthAuditStatus(authId, status, auditStatus, invalidReason, auditBy, auditTime);
@@ -1935,11 +1940,18 @@ public class AuthServiceImpl implements AuthService {
      * @param mobile
      * @return
      */
-    public ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile){
+    public ResponseJson<RossChallengeRoundVo> checkContestedInfo(String mobile,Integer authUserId){
+        //获取活动时间
+        ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
+        //活动时间内用户是否参与比赛
         RossChallengeRoundVo ross=new RossChallengeRoundVo();
-        RossChallengeRoundVo rossChallengeRoundVo = authMapper.getcontestedInfoByUserName(mobile);
-        if(null!=rossChallengeRoundVo&&null!=rossChallengeRoundVo.getContestStatus()){
-            ross.setContestStatus(rossChallengeRoundVo.getContestStatus());
+        if(null!=activityTime&&StringUtils.isNotEmpty(activityTime.getStartTime())&&StringUtils.isNotEmpty(activityTime.getEndTime())){
+            RossChallengeRoundVo rossChallengeRoundVo = authMapper.getcontestedInfoByUserName(mobile,activityTime.getStartTime(),activityTime.getEndTime());
+            if(null!=rossChallengeRoundVo&&null!=rossChallengeRoundVo.getContestStatus()){
+                ross.setContestStatus(rossChallengeRoundVo.getContestStatus());
+            }else{
+                ross.setContestStatus(0);
+            }
         }else{
             ross.setContestStatus(0);
         }
@@ -2020,10 +2032,17 @@ public class AuthServiceImpl implements AuthService {
      * @return
      */
     @Override
-    public ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile){
-        List<RossChallengeVideo> rossChallengeVideos = authMapper.checkVideoByUsername(mobile);
-        if(null!=rossChallengeVideos&&rossChallengeVideos.size()>=3){
-            return ResponseJson.success(-1,"抱歉,最多只能上传3个视频!!!",null);
+    public ResponseJson<List<RossChallengeVideo>> checkVideoByUsername(String mobile,Integer authUserId){
+        //获取活动时间
+        ChallengeActivityVo activityTime = authMapper.getActivityTime(authUserId);
+        if(null!=activityTime&&StringUtils.isNotEmpty(activityTime.getStartTime())&&StringUtils.isNotEmpty(activityTime.getEndTime())){
+            //活动时间内用户是否参与比赛
+            List<RossChallengeVideo> rossChallengeVideos = authMapper.checkVideoByUsername(mobile,activityTime.getStartTime(),activityTime.getEndTime());
+            if(null!=rossChallengeVideos&&rossChallengeVideos.size()>=3){
+                return ResponseJson.success(-1,"抱歉,最多只能上传3个视频!!!",null);
+            }else{
+                return ResponseJson.success();
+            }
         }else{
             return ResponseJson.success();
         }

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

@@ -144,6 +144,11 @@
         from cm_brand_auth_banner
         where authId = #{authId}
     </delete>
+    <select id="getClubUserIdByAuthId" resultType="java.lang.Integer">
+        select * from cm_brand_club_user cbcu1 left join cm_brand_auth a
+        on a.createBy = cbcu1.id
+        where a.authId=#{authId}
+    </select>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
         select a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
         a.createTime,a.authCode,
@@ -840,6 +845,7 @@
     </select>
     <select id="getcontestedInfoByUserName" resultType="com.caimei.model.vo.RossChallengeRoundVo">
         select * from cm_ross_challenge_round where userName=#{mobile}
+           and contestTime &gt; #{startTime} and contestTime &lt; #{endTime}
     </select>
     <select id="getVideoAll" resultType="com.caimei.model.vo.RossChallengeVideo">
         select cr.*,cba.authParty from cm_ross_challenge_video cr
@@ -860,6 +866,7 @@
     <select id="checkVideoByUsername" resultType="com.caimei.model.vo.RossChallengeVideo">
         select * from cm_ross_challenge_video
         where userName = #{mobile}
+          and releaseTime &gt; #{startTime} and releaseTime &lt; #{endTime}
     </select>
     <update id="upVideoDiggCount">
         update cm_ross_challenge_video

+ 2 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -197,7 +197,8 @@
     </select>
     <update id="upAuthByid">
         update cm_ross_challenge_round
-        set authId = #{authId}
+        set authId = #{authId},
+            authenticationStatus=1
         where clubUserId = #{clubUserId}
     </update>
 </mapper>